Integer Types
Integer data types are byte, short, int, long
Ex:
byte a = 127 ;
short b = 32767;
Data Type |
Width(bits) |
Minimum value MIN_VALUE |
Maximum value MAX_VALUE |
---|---|---|---|
8 |
-27 (-128) |
27-1 (+127) | |
16 |
-215 (-32768) |
215-1 (+32767) | |
32 |
-231 (-2147483648) |
231-1 (+2147483647) | |
64 |
-263 (-9223372036854775808L) |
263-1 (+9223372036854775807L) |
Character Type
Data Type |
Width (bits) |
Minimum Unicode value |
Maximum Unicode value |
---|---|---|---|
16 |
0x0 (\u0000) |
0xffff (\uffff) |
Floating-point Types
Data Type |
Width (bits) |
Minimum Positive Value MIN_VALUE |
Maximum Positive Value MAX_VALUE |
---|---|---|---|
32 |
1.401298464324817E-45f |
3.402823476638528860e+38f | |
64 |
4.94065645841246544e-324 |
1.79769313486231570e+308 |
Boolean Type
Data Type |
Width |
True Value Literal |
False Value Literal |
---|---|---|---|
not applicable |
true |
false |
Summary of Primitive Data Types & Wrapper Class
Data Type |
Width (bits) |
Minimum Value, Maximum Value |
Wrapper Class |
---|---|---|---|
boolean |
not applicable |
true, false (no ordering implied) |
Boolean |
byte |
8 |
-27, 27-1 |
Byte |
short |
16 |
-215, 215-1 |
Short |
char |
16 |
0x0, 0xffff |
Character |
int |
32 |
-231, 231-1 |
Integer |
long |
64 |
-263, 263-1 |
Long |
float |
32 |
±1.40129846432481707e-45f, ±3.402823476638528860e+38f |
Float |
double |
64 |
\'b14.94065645841246544e-324, \'b11.79769313486231570e+308 |
Double |