Java primitive data types
to represent numbers. Integers
Type |
Size |
Minimum value |
Maximum value |
byte |
8 bits |
-128 |
127 |
short |
16 bits |
-32768 |
32768 |
int |
32 bits |
-2147483648 |
2147483647 |
long |
64 bits |
-9223372036854775808 |
9223372036854775807 |
Floating point
Type |
Size |
Largest value |
Smallest value |
Precision |
float |
32 bits |
±3.4E+38 |
±1.4E-45 |
6 - 7 significant figures |
double |
64 bits |
±1.79E+308 |
±4.94E-324 |
14 - 15 significant figures |
|