Examveda
Examveda

Size of int in Java is

A. 16 bit

B. 32 bit

C. 64 bit

D. Depends on execution environment

Answer: Option B

Solution(By Examveda Team)

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.

This Question Belongs to Java Program >> Data Types And Variables

Join The Discussion

Comments ( 3 )

  1. Komal Agrahari
    Komal Agrahari :
    2 years ago

    Int has 4 bits we know that 1 byte acquire 8 bits then 4 bits acquire 4*8=32 bits

  2. Prakash Garapati
    Prakash Garapati :
    6 years ago

    Size of int in java
    4 bytes = 32 bit

  3. Sachin Dandge
    Sachin Dandge :
    7 years ago

    2^4

Related Questions on Data Types and Variables