MCQ Single Best Answer Easy

QWhat is size of integer in Java Programming.

ID: #2071 Java Data Types and Variables - MCQ 3,953 views
Question Info
#2071Q ID
EasyDifficulty
Java Data Types and Variables - MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 3 Bytes
  • B 4 Bytes
  • C 2 Bytes
  • D 8 Bytes
Correct Answer: Option B

Explanation

In Java programming, the primitive data type int has a size of 4 bytes. This means it occupies 32 bits of memory. The int data type is a signed integer type, and it can represent values in the range from -2,147,483,648 to 2,147,483,647 (inclusive). The range is calculated as

-231 to 231 -1

The default value for an int variable is 0.

Share This Question

Challenge a friend or share with your study group.