Primitive Types

Here is a table of the Java primitive types:

Type Size Min. Max.
byte 8-bit -128 127
short 16-bit -32,768 32,767
int 32-bit -2,147,483,648 2,147,483,647
long 64-bit -9,223,372,036,854,775,808 9,223,372,036,854,775,807
float single precision 32-bit IEEE $\pm$10-38$\pm$1038
double double precision 64-bit IEEE $\pm$10-308$\pm$10-308
char 16-bit \u0000 \uFFFF
boolean 1-bit false or true

Note: the min value is always 1 less than -max.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License