Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity
Encapsulation is one of the four fundamental OOP concepts. The other three are inheritance, polymorphism, and abstraction.
Encapsulation is the technique of making the fields in a class private and providing access to the fields via public methods.
If a field is declared private, it cannot be accessed by anyone outside the class, thereby hiding the fields within the class.
For this reason, encapsulation is also referred to as data hiding.
If a field is declared private, it cannot be accessed by anyone outside the class, thereby hiding the fields within the class.
For this reason, encapsulation is also referred to as data hiding.
The encapsulation is achieved by combining the methods and attribute into a class.
Encapsulation is a technique used for hiding the properties and behaviors of an object and allowing outside access only as appropriate.
No comments:
Post a Comment