Java Theory
Encapsulation:
1. Binding the data with its related functionalities known as encapsulation here data means variables and functionalities means methods.
2. Encapsulation is a process of wrapping of data and methods in a single unit is called Encapsulation.
Example:
Capsule, it is wrapped with different medicines. In a capsule, all medicine is encapsulated inside a capsule.