Data types
Data is classified into types, such as a set of whole numbers (also known as integers) or a set of
printing characters.
Different types of data are represented in different ways inside a computer and need varying
amounts of memory to store them. They also have different operations that can be performed
upon them. All values that belong to the same data type will be represented in the same way.
The most commonly supported data types in programming languages are:
Data type Example Size
Integer (whole number) 4, 27, 65535 1 to 8 bytes
Floating point (decimal
4.2, 27.4, 5.63 4 to 8 bytes
number)
Character a, F, 3, $, £, # 1 byte
abc, hello Limited to the amount that can be stored in main
String
world memory
Boolean true or false 1 bit
Data types may be different in different languages. The main data types are grouped under
hierarchies. They are either numbers, characters or logical. There are several types of number
values, including a distinction between whole numbers and floating-point numbers.