Java OCA OCP Practice Question 1125

Question

Which of the following are correct about "encapsulation"?

Select 2 options

  • A. Encapsulation is same as polymorphism.
  • B. Encapsulation helps make sure that clients have no accidental dependence on the choice of representation
  • C. Encapsulation helps avoiding name clashes as internal variables are not visible outside.
  • D. Encapsulation makes sure that messages are sent to the right object at run time.
  • E. Encapsulation helps you inherit the properties of another class.


Correct Options are  : B C

Note

Encapsulation is the technique used to package the information in such a way as to hide what should be hidden, and make visible what is intended to be visible.

Encapsulation means making the data variables private and providing public accessors.




PreviousNext

Related