Primitive data types in Java

Primitive Description Range
byte Byte-length integer (8 bits) -128 (-27) to 127 (27-1)
short Short integer (16 bits) -32,768 (-215) to 32,767 (-215-1)
int Integer (32 bits) -2,147,483,648 (-231) to 2,147,483,647 (-231-1)
long Long integer (64 bits) -9,223,372,036,854,775,808 (-263) to 9,223,372,036,854,775,807 (263-1)
float Single-precision floating point (32-bit IEEE 7541) Smallest positive nonzero: 14e-45 Largest positive nonzero: 3.4028234e38
double Double-precision floating point (64-bit IEEE 754) Smallest positive nonzero: 4.9e-324 Largest positive nonzero: 1.7976931348623157e308
char A Unicode character [See Unicode 6 specification]
boolean A boolean value true or false

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.