Skip to content
Sharp

Object-oriented programming · interview question

Why does having a well-defined API surface for a class help in practice?

Multiple choiceEasychapter-3-curatedpremiumoopgetters-and-setters-design
Choose one answer
Answer and explanation

Correct answer

C. It makes the class easier to use and understand.

Why

A well-defined API surface makes a class easier to use and understand by providing clear, consistent methods for interaction, while hiding unnecessary complexity and preserving encapsulation.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →