Data abstraction in JAVA

 Data abstraction

Abstraction refers to the act of representing essential features without including the background details or explanations. since the classes use the concept of data abstraction ,they are known as abstraction data type(ADT).


For example, a class Car would be made up of an Engine, Gearbox, Steering objects, and many more components. To build the Car class, one does not need to know how the different components work internally, but only know how to interface with them, i.e., send messages to them, receive messages from them, and perhaps make the different objects composing the class interact with each other.


An example for abstraction 

Humans manage complexity through abstraction. When you drive your car you do not have to be concerned with the exact internal working of your car(unless you are a mechanic). What you are concerned with is interacting with your car via its interfaces like steering wheel, brake pedal, accelerator pedal etc. Various manufacturers of car has different implementation of car working but its basic interface has not changed (i.e. you still use steering wheel, brake pedal, accelerator pedal etc to interact with your car). Hence the knowledge you have of your car is abstract.


Some of the Object-Oriented Paradigm are: 

1. Emphasis is on data rather than procedure. 

2. Programs are divided into objects. 

3. Data Structures are designed such that they Characterize the objects. 

4 Methods that operate on the data of an object are tied together in the data structure. 

5 Data is hidden and can not be accessed by external functions. 

6 Objects may communicate with each other through methods.

Post a Comment (0)
Previous Post Next Post