Encapsulation: The wrapping up of a data into a single unit.
Encapsulation refers to combining data and associated functions as a single unit.
For example- Capsule, it is wrapped with different medicines.
A java class is the example of encapsulation. Java bean is the fully encapsulated class because all the data members are private.
provide public getter and setter methods to access and update the value of a private variable.