Sunday, June 17, 2012

What is Encapsulation?

Encapsulation is the process of compartmentalising the elements of an abtraction that defines the structure and behaviour


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.


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