Java – integer range when using 64 bit JDK

As far as I know, there is a difference between 32 - bit and 2 - bit integers The 64 bits are as follows:

I use the 64 bit JDK, and I verify it by printing the following: system out. Println ("JVM bit size:" system. Getproperty ("sun. Arch. Data. Model");

Solution

The size of int in Java is completely independent of the 32 - bit or 64 - bit JDK It is always 4 bytes = 32 bits = - 2648 to 2647

If you need a 64 bit integer, use long, that is, 64 bits = 8 bytes

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>