PRIMITIVE DATA TYPE
Primitive data types are data types which are not defined with support of other data types.
Some of the primitive data types are:
1. Numeric types
2. Boolean types
3. Character types
- Numeric Types: These are the numbers.
- Integer: A data type that represents some range of mathematical integers. Different programming languages supports different size of integers. For example,
- Java includes four signed integer sizes: byte, short, int, and long.
- C++ and C#, include unsigned integer types (value without sign).
- int age = 20;
- Float type is the standard size, usually being stored in four bytes of memory.
- Double type is provided for situations where larger fractional parts and/or a larger range of exponents is needed.
The collection of values that can be represented by a floating-point type is defined in terms of precision and range.
- Precision is the accuracy of the fractional part of a value, measured as the number of bits.
- Range is a combination of the range of fractions and, more important, the range of exponents.
For example, in Python, (8 + 2j), contains j as imaginary number.