Day3 : Datatypes
Datatypes
There are two types of Datatype in Java one is Primitive and Other is non-primitive datatype. The following flowchart shows a subcategory of Datatypes.
Datatype Name + Size(In Byte) + Range:
- Byte - 1 Byte - Range: -128 to +127
- Short - 2 Byte - Range: -32,768 to +32,767
- Int - 4 Byte - Range: -2,147,433,648 to +2,147,433,647
- Long - 8 Byte - Range : -9,223,372,036,854,775,308 to +9,223,372,036,854,775,308
- Char - 2 Byte - Range: 0 to 65535(UNICODE)
- Boolean - 1Byte(8 bit) or 1 Bit - Actually It's size is dependent on JVM some JVM takes 8 Bit Or Some takes 1 Bit
- float - 4 Byte - Range: -3.4 * 10^38 to +3.4 * 10^38
- double - 8 Byte - Range: -1.7*30^308 to +1.7*30^308
Comments