Java has more integer types beyond int:
byte uses bits. Range: to . Good for raw binary data or saving memory in large arrays.
short uses bits. Range: roughly to . Rarely used in practice.
long uses bits. Range: up to about quintillion. Use it when int's billion limit isn't enough.
byte small = 100;
short medium = 30000;
long big = 9000000000L;
Notice the L suffix on the long value. Without it, Java treats the number as int and throws an error if it's too large. In day-to-day coding, you'll mostly use int and reach for long only when values exceed billion.