The maximum value that can be stored in a signed 32-bit int in Java is 2,147,483,647. Java’s int type always uses 32 bits and represents values with a signed two’s-complement format, giving it a range from −2³¹ to 2³¹−1.
That upper limit is one less than 2,147,483,648 because one of the 32 bits represents the sign. The corresponding hexadecimal value is 0x7FFFFFFF. Java exposes this boundary through the constant Integer.MAX_VALUE.
A common mix-up is 32,767, which is the maximum value for a signed 16-bit integer, such as Java’s short type. The number 2,147,483,648 is also incorrect: it is the first value beyond the positive range and cannot be stored in an int. Java’s long type, which is 64-bit, is used when substantially larger whole numbers are required.