First, the characteristics of the basic data type, number of digits, maximum and minimum values.
1.
Basic type: Short bits number: 16
Packing type: Java.lang.Short
Minimum value: short.min_value=-32768 (-2 of 15 this party)
Maximum value: short.max_value=32767 (2 of 15 square-1)
2.
Base type: int bits number: 32
Packing type: Java.lang.Integer
Minimum value: integer.min_value=-2147483648 (-2 of 31 squares)
Maximum value: integer.max_value= 2147483647 (2 of 31 square-1)
3.
Basic type: Long bits number: 64
Packing type: Java.lang.Long
Minimum value: long.min_value=-9223372036854775808 (-2 of 63 squares)
Maximum value: long.max_value=9223372036854775807 (2 of 63 square-1)
4.
Base type: Float bits number: 32
Packing type: java.lang.Float
Minimum value: float.min_value=1.4e-45 (2-149-square)
Maximum value: Float.max_value=3.4028235e38 (2 of 128 square-1)
5.
Basic type: Double bits number: 64
Packing type: java.lang.Double
Minimum value: double.min_value=4.9e-324 (2-1074-square)
Maximum value: double.max_value=1.7976931348623157e308 (2 of 1024 square-1)
Basic type |
Number of bytes |
Number of digits |
Maximum Value |
Minimum value |
Byte |
1byte |
8bit |
2^7-1 |
-2^7 |
Short |
2byte |
16bit |
2^15-1 |
-2^15 |
Int |
4byte |
32bit |
2^31-1 |
-2^31 |
Long |
8byte |
64bit |
2^63-1 |
-2^63 |
Float |
4byte |
32bit |
3.4028235E38 |
1.4E-45 |
Double |
8byte |
64bit |
1.7976931348623157E308 |
4.9E-324 |
Char |
2byte |
16bit |
2^16-1 |
0 |
Range of values for short, int, long, float, double in Java