Encapsulation
Encapsulation is implemented in C++ as a class that encapsulates data and the methods that operate on it. Data is typically designated as private so that it cannot be accessed outside of the class. The public functions are defined and may be retrieved by using the class’s objects.
Two properties of Encapsulation:
- Data member and variables are declared private to ensure security.
- Member function are declared public so so that anyone can’t change and work according to that function.