Computer Applications
How is data abstraction associated with encapsulation ?
OOP Intro Java
7 Likes
Answer
Abstraction and encapsulation are complementary concepts. Abstraction focuses upon the observable behaviour of an object, whereas encapsulation focuses upon the implementation that gives rise to this behaviour. Encapsulation is most often achieved through information hiding, which is the process of hiding all the secrets of an object that do not contribute to its essential characteristics, the structure of an object is hidden, as well as the implementation of its methods. Only the essential characteristics of object are visible.
Thus, encapsulation is a way to implement data abstraction. Encapsulation hides the details of the implementation of an object.
Answered By
3 Likes