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.
Encapsulation provides a way to protect the data from accidental corruption.