Quote:Abstraction: In bare terms it means “Understanding”. Better understanding of the system leads to good solution.
Data Abstraction: Data Abstraction (In OOP also known as Object Abstraction) purely talks about the understanding of the Developer about the system that is specific to the given DATA.
So there can be Levels of Abstraction to understand the system which differs from developer to developer. Better systems can be developed with higher levels of abstraction.
Difference: Encapsulation is the deliverables of Abstraction. Encapsulation barely talks about grouping up your abstraction to suit the developer needs. Abstraction solves the problem in the design side while encapsulation is the implementation.
Quote:Encapsulation means we hide the data from directly
interaction and Abstraction means
we bother about what the object can do but don't bother
about how it does?
Quote:Encapsulation means we are hiding the code and data in to a
single unit to protect the data from outside world.
Abstraction means we know about the object how it can be
used but we dont know how it is implemented. and we can
hide the data using the AccessSpecifiers.
Quote:Data abstraction in OOP is the concept of abstracting the implemetaion to the user. It just gives the functional description but not the implementaion part.
Take an abstract class or an interface for example, it gives the user some method descriptions, but not the internal implementaion.
While Encapsulation in OOP is the process of hiding or securing data from outside functions. The data is strictly binded with function members declared in the same class.
For example in C# we can use properties insde the class to manipulte or access the private data declared in the same class, but cannot do so from outside functions.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)