what is difference between abstraction and encapsulation? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what is difference between abstraction and encapsulation?

8th Feb 2017, 6:03 PM
Usman Dar
Usman Dar - avatar
2 Answers
+ 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.
8th Feb 2017, 6:48 PM
GeekyShacklebolt
GeekyShacklebolt - avatar
0
l ..jm
6th Apr 2017, 4:40 PM
Mosaab abd
Mosaab abd - avatar