Skip to content
Sharp

Object-oriented programming · interview question

Which of the following statements about encapsulation is true?

Multiple choiceMediumchapter-3-curatedpremiumoopimmutability-basics
Choose one answer
Answer and explanation

Correct answer

B. Encapsulation helps in hiding the internal state of an object.

Why

Encapsulation refers to hiding the internal state and requiring all interaction to occur through an object's methods, which helps in maintaining control over the data and protecting it from outside interference and misuse.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →