answersLogoWhite

0

In reality, it's not. 2,147,483,647 is the largest number that an int type can hold. This is because Java uses a 32-bit signed integer value for ints. Since it's signed, one bit needs to hold the sign value, leaving us 31 bits for storage. 231 = 2,147,483,648, which is the total number of values which can be held in 31 bits. Since we also need to store a zero, our maximum is 2,147,483,647. The total range of data which can be held in an int is [-2,147,483,648 : 2,147,483,647].

But, as was said above, this is not the biggest number Java can handle. It also has support for 64-bit long integer types. This type can hold values in the range [-9,223,372,036,854,775,808 : 9,223,372,036,854,775,807].

And finally we have the BigInteger class, which can hold infinitely large numbers, limited only by the physical capacity of your storage space (RAM).

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake
ProfessorProfessor
I will give you the most educated answer.
Chat with Professor
SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve

Add your answer:

Earn +20 pts
Q: Why is 2147483647 the biggest number Java can handle?
Write your answer...
Submit
Still have questions?
magnify glass
imp