Skip to content
Sharp

Object-oriented programming · interview question

Which of the following best describes a field in a Java class?

Multiple choiceEasychapter-2-curatedpremiumoopfields-and-state
Choose one answer
Answer and explanation

Correct answer

B. A variable that holds the state of an object

Why

Fields represent the state of an object by storing data. They are defined within a class and are used by the object's methods to perform operations and return results.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →