Tuesday, 26 January 2016

Encapsulation,Data Hiding & Abstraction

Encapsulation

Binding(or wrapping) code and data together into a single unit is known as Encapsulation.
For Example:
                  Capsule, it is wrapped with different Medicines

Classes Encapsulate (.. i.e wrap) attributes and member functions into objects and this is known as Encapsulation.

Data Hiding

Data is made hidden from the user by making them private.This is known as Data Hiding
For Example:
                  Private or Protected

Abstraction

Hiding internal detail and showing functionality is called Abstraction.
For Example:
                Phone call, we dont know the internal processing

0 comments:

Post a Comment