Question

Encapsulation is often described as a "protective barrier" that prevents the data from being accessed by the code outside the class. This statement is:

A False, encapsulation is about inheritance.
B True, it's about data hiding and controlled access.
C False, it's about polymorphism.
D True, but only for abstract classes.
E False, it's about code reusability.
Practice Next

Hey! Ask a query