Difference Between Data Hiding and Data Encapsulation - CodeTextPro | Web Tutorial | Technology

CodeTextPro.com Provides - Web design, Technology gyan, Digital marketing, Online earnings, Seo, Adsense, Technology news, Motivation and inspiration, Latest Technology Affairs, Gadgets, Blogging

Saturday, August 10, 2019

Difference Between Data Hiding and Data Encapsulation

Difference between data encapsulation and hiding.
The main difference between data hiding and data encapsulation are in the below.

Data Encapsulation
  1. Encapsulation is the process of combining data and function into a single unit called class.
  2. The data in encapsulation is either public or private.
  3. The data is encapsulated using the class keyword.

Data Hiding
  1. Data Hiding is the mechanism where the details of the class are hidden from the outside world.
  2. The data in data hiding is considered as private and non-accessible.
  3. The data hiding is implemented the access specifier. i.e - public, private & protected.

No comments:

Post a Comment