Is Abstraction and Data Hiding Same?

Data hiding is the process that ensures exclusive data access to class members and provides object integrity by preventing unintended or intended changes. Abstraction, on the other hand, is an OOP concept that hides the implementation details and shows only the functionality to the user.

Is data hiding and encapsulation same?

Data hiding concentrates on the accessibility of an object member within a class, while data encapsulation focuses on how the data is accessed and how different objects behave. ... Data hiding is both a process and technique in itself, whereas data encapsulation is a sub-process in data hiding.

How does abstraction help in data hiding?

The main purpose of abstraction is hiding the unnecessary details from the users. Abstraction is selecting data from a larger pool to show only relevant details of the object to the user. It helps in reducing programming complexity and efforts. It is one of the most important concepts of OOPs.

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.