Skip to content
Sharp

Object-oriented programming · interview question

How does encapsulation help in maintaining a trustworthy store model in an e-commerce application?

Multiple choiceMediumchapter-3-curatedpremiumoopencapsulation
Choose one answer
Answer and explanation

Correct answer

D. It ensures that business rules are consistently applied

Why

Encapsulation ensures that all operations on objects adhere to the defined business rules, thereby maintaining consistency and trustworthiness in the store model by preventing unauthorized or inappropriate state changes.

Test yourself on Object-oriented programming

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

Start free test
All Object-oriented programming questions →