Java · Question 17 · Easy

What is the size of the int data type in Java, regardless of the platform?

  1. 64 bits
  2. 32 bits
  3. It depends on the operating system
  4. 16 bits
Answer and explanation

Answer: B. 32 bits

Explanation: Java fixes the sizes of its primitive types in the language specification, so an int is always a 32-bit signed integer on every platform.

Previous: Which of the following is NOT a primitive data type in Java? · Next: What will be the output of the following Java program?

Practise java

Try a fresh set of java questions with an explanation after every answer, free and without signing up: Java practice. Or sit a full placement mock test.

More java questions

More technical & programming practice

Python · Data Structures · Algorithms · Object-Oriented Programming · DBMS · SQL · Operating Systems · Computer Networks

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge