Encapsulation means keeping actions and attributes together under a single unit.This can also be understood using a motor bike example. A bike has actions such as ’switch on light’, ’horn’ etc. and attributes such specific color, size, weight etc. Here the actions and attributes are bundled together under a single unit, bike.In a programming language, methods and properties that correspond to actions and attributes respectively are kept under a unit called object. The advantage of encapsulation is that the implementation is not accessible to the client. The user has
to know only the functionality of encapsulated unit and information to be supplied to get the result.