Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which OOP concept hides internal data from outside access ?

  • A.Encapsulation
  • B.Inheritance
  • C.Polymorphism
  • D.Abstraction

Answer: A

Hiding internal data from outside access is encapsulation.

Encapsulation bundles an object's data and the methods that work on it into one unit and restricts direct access to the data, typically by making fields private and exposing them only through public methods. Outside code cannot change the internal state except in the ways the class allows.

Abstraction is the near miss: it hides implementation complexity and shows only essential features, a design idea rather than data protection. Inheritance reuses a class's members in a new class, and polymorphism lets one interface take many forms.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.