Java: Ranges of Primitive Types

Ranges are inclusive in both ends.

byte −128 127
−27 27−1
Byte.MIN_VALUE Byte.MAX_VALUE
short −32,768 32,767
−215 215−1
Short.MIN_VALUE Short.MAX_VALUE
int −2,147,483,648 2,147,483,647
−231 231−1
Integer.MIN_VALUE Integer.MAX_VALUE
long −9,223,372,036,854,775,808 9,223,372,036,854,775,807
−263 263−1
Long.MIN_VALUE Long.MAX_VALUE
float −3.40282347×1038 3.40282347×1038
−1.111…1×2127 1.111…1×2127
-Float.MAX_VALUE Float.MAX_VALUE
double −1.7976931348623157×10308 1.7976931348623157×10308
−1.111…1×21023 1.111…1×21023
-Double.MAX_VALUE Double.MAX_VALUE
char \u0000 \uFFFF
0 65,535
0 216−1
Character.MIN_VALUE Character.MAX_VALUE


For more details: Java: Primitive Types.

Comments

Be the first to comment!