Skip to content
Sharp

Object-oriented programming · interview question

How would you explain an instance variable in a Java class in an interview?

Multiple choiceEasychapter-2-curatedpremiumoopobject-interaction
Choose one answer
Answer and explanation

Correct answer

C. A variable that is associated with an instance of the class.

Why

An instance variable is associated with an instance of a class, meaning each object created from the class has its own copy of the variable.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →