Data hiding and encapsulation are correlative ideas. Data hiding concentrates on the accessibility of an object, while encapsulation concentrates on how the data is accessed and how different objects behave.
Why is encapsulation known as data hiding?
In encapsulation, the variables of a class will be hidden from other classes, and can be accessed only through the methods of their current class. Therefore, it is also known as data hiding. ... Provide public setter and getter methods to modify and view the variables values.
Is information hiding result of encapsulation?
Information Hiding - It is the process of hiding the implementation details of an object. It is a result of Encapsulation.