In programming, a data type is a classification that specifies what kind of value a variable has and what kind of mathematical, relational, or logical operations can be applied to it.
For example, an integer is a data type used to classify integers, and a char is a data type used to classify a letter.
Depending on the programming language, there are different types of data types. There is also a distinction between primitive and non-primitive data types. Primitive data types use a small memory area to represent a single data element, using bit patterns. Non-primitive data types are objects. An object is a block of memory that contains a large amount of data and methods. These methods can be used to manipulate the data.
This is a numeric data type used to store numbers without decimal places.
This is also a numeric data type used to store numbers with decimal places.
A character data type is used to store a single character. This can be a letter, number, punctuation mark or symbol.
The String datatype is a sequence of characters and is the most commonly used datatype for storing text. In addition, a string can also contain digits and symbols, but is always treated as text.
Boolean data types can only have the value 0 (false) or 1 (true).
An array, also known as a list, is a data type that stores a number of elements, usually all of the same type.
Each element of an array can be retrieved using an integer index, and the total number of elements in an array represents the length of the array.