Difference between data encapsulation and hiding.
The main difference between data hiding and data encapsulation are in the below.
Data Encapsulation
- Encapsulation is the process of combining data and function into a single unit called class.
- The data in encapsulation is either public or private.
- The data is encapsulated using the class keyword.
Data Hiding
- Data Hiding is the mechanism where the details of the class are hidden from the outside world.
- The data in data hiding is considered as private and non-accessible.
- The data hiding is implemented the access specifier. i.e - public, private & protected.
0 Comments