L Primitive Types

Fig. L.1 Java primitive types.

Type Size in bits Values Standard
boolean true or false  
[Note: A boolean’s representation is specific to the Java Virtual Machine on each platform.]
char 16 '\u0000' to '\uFFFF' (0 to 65535) (ISO Unicode character set)
byte 8 –128 to +127 (27 to 271)  
short 16 –32,768 to +32,767 (215 to 2151)  
int 32 –2,147,483,648 to +2,147,483,647 (231 to 2311)
long 64 –9,223,372,036,854,775,808 to +9,223,372,036,854,775,807 (263 to 2631)
float 32 Negative range: –3.4028234663852886E+38 to –1.40129846432481707e–45 Positive range: 1.40129846432481707e–45 to 3.4028234663852886E+38 (IEEE 754 floating point)
double 64 Negative range: –1.7976931348623157E+308 to –4.94065645841246544e–324 ...

Get Android How to Program, 3/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.