+ 1
what is difference between abstraction and encapsulation?
2 ответов
+ 1
abstraction: in general is showing the relevant data to the user while hiding the back ground details.
and in OOp point of view (since it models real world) it is best understand with the concept of classes.
classes have objects. which can (directly) access only the stuff available in its public section.
thatswhy objects are only able to see the members in public section which is a very brief e.i of abstraction, that i have given.
ON THE OTHER HAND.
Grouping of data and there associated functions together in a single unit is called encapsulation.
again it is implemented via Classes.
as an object of a class have data members and there associated funct. in it. is encapsulation.
0
l ..jm