Data Abstraction and Data Encapsulation both of these features are considered as the pillars of object-oriented programming language, but they have different functionality and implementation mechanism.
Let us know how these two OOPs features are different from one another.
Data Abstraction | Data Encapsulation |
---|---|
Data Abstraction can be described as the technique of hiding internal details of a program and exposing the functionality only. | Data Encapsulation can be described as the technique of binding up of data along with its correlate methods as a single unit. |
Implementation hiding is done using this technique. | Information hiding is done using this technique. |
Data abstraction can be performed using Interface and an abstract class. | Data encapsulation can be performed using the different access modifiers like protected, private, and packages. |
Abstraction lets somebody see the What part of program purpose. | Encapsulation conceals or covers the How part of the program's purpose. |