Skip to content
Sharp

Object-oriented programming · interview question

Which statement best describes the relationship between fields and instance methods in a well-designed Java class?

Multiple choiceHardchapter-2-curatedpremiumoopinstance-methods
Choose one answer
Answer and explanation

Correct answer

A. Fields represent state, and instance methods define behavior that can query or modify this state.

Why

In a well-designed Java class, fields hold the state of an object, while instance methods define the behavior that operates on this state, allowing for queries or modifications as needed.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →