Difference between Abstraction and Encapsulation

Abstraction:

It is virtual class design.
Representation of data that how we represent it.
Before actually defining class developer will think about about the properties, methods and events will be there in class.

Encapsulation:

Hiding of unnecessary data.
At the time of class definition developers will think about which should display to end user and which should not.

Conclusion:
Abstraction is collection of data and Encapsulation is exposure of data in appropriate access specifier.

No comments: