Encapsulation means to hide the internal details and provide a medium to access it. It is a fundamental
concept of object-oriented programming language (OOP’s). It is used to describe the
binding of data and method in a single unit.
In other word’s you can also say this, it is a mechanism of hiding the data and a member function of the class and
only shows the functionality to the user. The real-life example of encapsulation is “using
phone call”, you don’t know the internal working of phone call and how to work internal process.