In programming, data Abstraction is an essential technique that allows developers to organize and manage complex code by reducing dependencies and increasing modularity. It is a process of simplifying and presenting complex data structures, classes, and functions in a more straightforward way, making them easier to understand and use. Throughout this tutorial, we will dive deeper into what Data Abstraction is, how it works, and its practical application.

Table of Contents :

  • OOPs Concepts - Data Abstraction
    • Real World example for Data Abstraction

OOPs Concepts - Data Abstraction

  • Data abstraction in object oriented programming refers to the approach of hiding the code implementation details from the user.
  • Data abstraction ensures that only the necessary details of class data are visible to the outside world.
  • The code implementation of functions to process data is hidden from the users.
  • The users can see the necessary data of a class and the end result after processing that data, 
  • but they do not know how that data was processed within the class.

Real World example for Data Abstraction :

The process of data abstraction can be understood by taking a real world example. In our previous example of Vehicles class.

  • Suppose we are driving a scooter.
  • The driver can view the current speed of the scooter.
  • The driver knows that on accelerating the current speed of the scooter will increase.
  • But the driver will not know that how current speed is getting increased on accelerating.
  • These key details and implementation of the mechanism is hidden from the driver.
  • This is called Data abstraction.

Prev. Tutorial : What is Encapsulation

Next Tutorial : What is Inheritance