CSE Helper
Powered By Dream Dragon Creation
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 field within the class
Encapsulation can be described as a protective barrier that prevents the code and data being randomly accessed by other code defined outside the class. Access to the data and code is tightly controlled by and inteface.
The main benefit of Encapsulation is the ability to modify our implemented code without breaking the code of others who use our code. With this feature Encapsulation gives maintainability, flexibility and extendsibility to our code.

The public methods are the access points to this class's fields from the outside java world. The variables of the Encap Test class can be access as below.
