For storing integers, Java provides a range of data-type possibilities,
including byte
, short
, int
, and
long
. Java compiler implementers are required to use a
standard number of bytes for each:
Type | Bytes | Stores |
byte | 1 | integer |
short | 2 | integer |
int | 4 | integer |
long | 8 | integer |