Question

What is the primary purpose of Encapsulation in Object-Oriented Programming?

A To allow a class to inherit properties from another class.
B To hide the implementation details and show only essential features.
C To bundle data and methods that operate on the data within a single unit.
D To allow objects of different classes to be treated as objects of a common superclass.
E To create multiple methods with the same name but different parameters.
Practice Next

Hey! Ask a query