Monday, January 28, 2019

Encapsulation in Object oriented programming

Encapsulation is used to hide the code and data in a single unit to protect the data from the outside the world. Class is the best example of encapsulation.

Encapsulation provides a way to protect the data from accidental corruption.