Is integer size in java of fixed length or variable size?
ex: 1 or 10000 does both the number takes same space during allocation?
Java integers are 32 bits (4 octets) as per the JLS.
The integral types are byte, short, int, and long, whose values are 8-bit, 16-bit, 32-bit and 64-bit signed two's-complement integers, respectively.
byte
short
int
long
Source: JLS §4.2 Primitive Types and Values