Data Abstraction vs Data Hiding | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 4

Data Abstraction vs Data Hiding

Which concepts of OOPS means exposing only necessary information to client? Is it Abstraction or Data hiding I answered Abstraction... but the following site says, its Data hiding http://www.indiabix.com/cpp-programming/oops-concepts/001002 (Question no 10) But What is the exact difference between Data Abstraction and Data Hiding Pardon me if the question seems silly..

11th Dec 2018, 2:27 PM
Shreyansh
Shreyansh - avatar
2 ответов
+ 1
My interpretation: Abstraction can be interpreted as a result of data hiding. The user of the class has only access to what he needs (setter, getter) while the complications are hidden away, so he/she only sees a 'summary' of what's going on, the abstraction.
11th Dec 2018, 3:57 PM
HonFu
HonFu - avatar
+ 1
Data hiding (i interpret this as encapsulation) is where the Class make its data only accessible by itself. Meanwhile Abstraction as HonFu said, is an interface for outside element to interact with its data without changing them directly
11th Dec 2018, 4:05 PM
Taste
Taste - avatar