Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On a 64-bit machine is the size of an int in Java 32 bits or 64 bits?

Tags:

java

On a 64-bit machine is the size of an int in Java 32 bits or 64 bits?

like image 993
jon077 Avatar asked Dec 30 '08 15:12

jon077


People also ask

Is Java int 32 or 64-bit?

The number of bits used to represent an int value is the constant Integer. SIZE, which is specified as public static final int SIZE = 32; since Java 1.5.

Is Java int 32-bit?

int type. The int data type is a 32-bit signed Java primitive data type. A variable of the int data type takes 32 bits of memory. Its valid range is -2,147,483,648 to 2,147,483,647 (-231 to 231– 1).


1 Answers

32 bits. It's one of the Java language features that the size of the integer does not vary with the underlying computer. See the relevant section of the spec.

like image 123
Thomas Jones-Low Avatar answered Sep 30 '22 02:09

Thomas Jones-Low