What is the difference between encapsulation and data abstraction? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

What is the difference between encapsulation and data abstraction?

10th Jul 2016, 1:53 PM
Anoop E
Anoop E - avatar
1 ответ
+ 8
Encapsulation means hiding the data using access modifiers like public private etc and add restrictions. And also adding the method and variable into a single entity Abstraction means hiding the complex implementation using interface or abstract class. e.g. Hiding the complexity of changing the gear in a car by providing gear interface known as abstraction. But if you see car as a entity having tyres and metal body known as encapsulation.
15th Jul 2016, 8:21 PM
deepanshu7211