Integer range when using 64bit jdk

The size of an int in Java is completely independent of the 32-bitness or 64-bitness of a JDK. It is always 4 bytes = 32 bits = −2,147,483,648 to 2,147,483,647.

If you want a 64-bit integer, use a long, which is always 64 bits = 8 bytes.

Leave a Comment