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

Whats the difference between abstraction and encapsulation?

2nd Mar 2017, 6:45 PM
ManDevil777
2 Answers
+ 1
Encapsulation means you're hiding data from the rest of the program, whereas abstraction means you're hiding data from the user.
2nd Mar 2017, 6:53 PM
DaemonThread
DaemonThread - avatar
+ 1
encapsulation means you are wrapping up data and functions in a single unit called class while abstraction means you are using some features without knowing how exactly its defined as in case of classes you can access public data and functions using objects and data using member functions.
3rd Mar 2017, 3:11 PM
Anubhav Shukla
Anubhav Shukla - avatar