Primitive types

Figure 107. Java types Slide presentation Create comment in forum

Figure 108. Java primitive types, Part 1 Slide presentation Create comment in forum
Name Bytes Type Range Literal samples
byte 1 Signed integer [ - 2 7 , 2 7 - 1 ] -
short 2 Signed integer [ - 2 15 , 2 15 - 1 ] -
int 4 Signed integer [ - 2 31 , 2 31 - 1 ] 0, 1, +1, -42, 0b1101, 017, 0xC
long 8 Signed integer [ - 2 63 , 2 63 - 1 ] 0L, 1L, +1L, -42L, 0b1101L, 017L, 0xCL

Figure 109. Java primitive types, Part 2 Slide presentation Create comment in forum
Name Bytes Type Range Literal samples
char 2 Unsigned integer [ 0 , 2 16 - 1 ] 'A', '*', '-', 'Ç', '⇶' ...
float 4 Floating point ± 1.18 × 10 - 38 to ± 3.4 × 10 38 3.14f, 0.022f, -3.4E-24f
double 8 Floating point ± 2.23 × 10 - 308 to ± 1.8 × 10 308 3.14, 0.022, -3.4E-24, 3.14d,...
boolean ? Logical value not applicable true, false