ExamVeda
Login
Home
Data Types and Variables
?

Size of int in Java is

Answer & Solution
Correct Answer: Option B
The size of an int in Java is 32 bits.

Here's the breakdown:

Option A: 16 bit - This is not correct. The int data type in Java is 32 bits in size, not 16 bits.

Option B: 32 bit - This is the correct size of an int in Java. An int occupies 32 bits of memory in Java, allowing it to represent a wide range of whole numbers.

Option C: 64 bit - This size is not correct for an int in Java. A 64-bit data type is larger and typically used for long integers.

Option D: Depends on execution environment - The size of an int in Java is standardized and is always 32 bits regardless of the execution environment. It is not dependent on the platform or execution environment.

So, the correct size of an int in Java is 32 bits.
Examveda
Question posted by Examveda
Community

Join the Discussion

3 Comments
Komal Agrahari
Komal Agrahari 5 years ago
Int has 4 bits we know that 1 byte acquire 8 bits then 4 bits acquire 4*8=32 bits
Prakash Garapati
Prakash Garapati 9 years ago
Size of int in java
4 bytes = 32 bit
Sachin Dandge
Sachin Dandge 9 years ago
2^4