Encapsulation VS Abstaction

Encapsulation is an object you can use, abstraction is an ideal you can only discuss. encapsulation is why you wear underwear, abstraction is how you explain the difference between underwear and swimsuits .


  re: Encapsulation vs Abstraction
smr replied to waqar naaem
03-Oct-11 05:26 AM
HI

Data Encapsulation : It is a process of bundling the data, and the functions that use them, as a single unit( atleast in C++) . In C++ the data type "class" is used to achieve this.

Data Abstraction : It is a process of exposing only the interfaces and hiding the implementation details from the user. The interface exposed will remain the same: even if the internal implementation changes. This helps the user to use the new functionality without rewriting the client that was designed for previous implementation (strictly speaking ... previous interface).

Comments