Java Primitive Data Types
Primitive Type |
Size | Minimum | Maximum |
Wrapper Class |
---|---|---|---|---|
boolean | N/A |
No minimum or maximum. Possible values are true and false. |
Boolean | |
char | 16-bit |
Unicode 0 0 \u0000 |
Unicode 216-1 65535 \uFFFF |
Character |
byte | 8-bit |
-27 -128 |
27-1 +127 |
Byte |
short | 16-bit |
-216 -32768 |
+216-1 32767 |
Short |
int | 32-bit |
-232 -2147483648 |
+232-1 2147483647 |
Integer |
long | 64-bit |
-264 -9,223,372,036,854,775,808 |
+264-1 9,223,372,036,854,775,807 |
Long |
float | 32-bit |
IEEE754 floating-point Negative minimum: -3.4028234663852886E+38 Positive minimum: 1.40129846432481707E-45 |
IEEE754 floating-point Negative maximum: -1.40129846432481707E-45 Positive maximum: 3.4028234663852886E+38 |
Float |
double | 64-bit |
IEEE754 floating-point Negative minimum: -1.7976931348623157E+308 Positive minimum: 4.94065645841246544E-324 |
IEEE754 floating-point Negative maximum: -4.94065645841246544E-324 Positive maximum: 1.7976931348623157E+308 |
Double |