Types of abstraction in Java

There are two types of abstraction in Java including control abstraction and data abstraction.
 Control abstraction is used for building new functionalities and it also combines control statements in a single unit. This is a fundamental feature of every high-level language and forms the main unit of structured programming. This type of abstraction is used whenever we want to create a function for performing any given task.

Data Abstraction in Java is the process of reducing the object to its essence in order to only display the necessary characteristics to users. Abstraction defines an object in terms of attributes, methods and interfaces. In this article, we will be discussing the top interview questions based on data abstraction. 

We can achieve data abstraction through Abstract classes and interfaces. Through abstract classes, you can achieve partial or complete abstraction as abstract classes contain methods that have an implementation which can result in partial abstraction. On the other hand, interfaces allow complete (100%) abstraction since these allow users to abstract the implementation completely. In Java, data abstraction is implemented through abstract keywords while declaring a class or a method. 

Through data abstraction, the only essential information in a program is displayed without presenting the background details to the outside world. Other benefits include:

Reducing complexity
Increasing software reuse
Avoiding Code Duplication
Easing the burden of maintenance 
Increasing Security and confidentiality
Posted on by