Skip to content
Sharp

Core Java · interview question

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

Multiple choiceEasychapter-2-curatedpremiumcore-javacode-reading-and-refactoring-to-objects
Choose one answer
Answer and explanation

Correct answer

A. 0

Why

In Java, the default value for an instance variable of type int is 0. Primitive types like int have specific default values when they are instance variables.

Test yourself on Core Java

A free test with instant, explained results. No account needed.

Start free test
All Core Java questions →