Encapsulation
Get familiar with important aspects of object-oriented programming called data hiding and encapsulation.
Data hiding
Data hiding is an essential concept in object-oriented programming. In simple terms, it can be defined as masking a class's internal operations and only providing an interface through which other entities can interact with the class without being aware of what is happening within.
The goal is to implement classes in a way that prevents unauthorized access to or modification of the original contents of a class by its instances (or objects). The underlying algorithms of one class need not be known to another class. The two classes can still communicate, though.
Components of data hiding
Data hiding can be divided into two primary components: