1. Home
  2. Computer Science MCQs
  3. JAVA
  4. What is the default value of an int instance variable in…

Added 2 Nov 2026

What is the default value of an int instance variable in Java?

  1. null
  2. −1
  3. 1
  4. 0 Correct answer

Correct answer

D. 0

14 views

MCQSEXAM

Explanation

Instance variables of type int default to 0. Object references default to null, and local variables get no default at all: they must be initialised before use.

Reference

Asked in: NTS, PPSC, FPSC, OCA Java

Preparing for an exam?

Doubts & discussion

Not sure why the answer is D? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More JAVA MCQs

Practise all JAVA MCQs

Similar MCQs