

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference Between Abstraction and Data Hiding
In this post, we will understand the difference between data abstraction and data hiding.
Data Abstraction
It is one of the object-oriented methodologies.
It is defined as the process of hiding the internal implementation and keeping the complicated procedures hidden from the user.
Only the required services or parts are displayed.
This is usually achieved using ‘abstract’ class concept, and by implementing interfaces.
Only the important details are highlighted.
The rest of the intricate details are not shown to the user.
There are three types of abstraction
Procedural abstraction − Procedures are written as methods/functions one followed by the other. It is done in sequence in order to obtain abstraction.
Data Abstraction − Abstraction is achieved using data set that is used to describe the object of the class.
Control Abstraction − Here, it is achieved by using objects by ensuring that the details of the object are hidden from user.
It helps secure the software.
It doesn’t affect end users, since the developers can perform changes internally.
It ensures that the application is flexible, and user-friendly.
It can be implemented by creating a class that only represents important attributes, without including background detail.
Data Hiding
Data hiding refers to the task of hiding the internal data from outsiders.
The internal data won’t be accessible by irrelevant people.
This can be achieved using access specifiers, such as ‘private’, and ‘protected’.
This acts as a security layer.
This ensures that users can’t access internal data without authentication.
Getters and setters can be used to access the data or to modify it.
Getters help in getting, i.e accessing the private data.
Setters help in changing the settings of data, i.e modifying the private data.
- Related Questions & Answers
- Difference Between Data Hiding and Encapsulation
- Difference Between Abstraction and Encapsulation
- Explain difference between Abstraction and Encapsulation in PHP.
- Difference between Method Overriding and Method Hiding in C#
- What is the difference between abstraction and encapsulation in Java?
- What is the difference between overriding and hiding in C#?
- Difference Between Data and Information
- Difference Between Data and Metadata
- Data Hiding in Python
- What is the difference between function overriding and method hiding in C#?
- What is the difference between method hiding and method overriding in Java?
- What is the difference between method overloading and method hiding in Java?
- Difference between data type and data structure
- Difference Between Data Mining and Data Warehousing
- Difference Between Data Warehouse and Data Mart