Data abstraction is the most essential function of object-oriented programming in Java. Abstraction means displaying only basic information and hiding the details. Data abstraction refers to providing only necessary information about the data to the outside world, hiding the background info or implementation.
We can implement Abstraction in Java using classes. The class helps us group data members and member functions using available access specifiers. A class can decide which data member will be visible to the outside world and not.
In common terms, Encapsulation is defined as wrapping up of data and information under a single unit. In object-oriented programming, Encapsulation is defined as binding together the data and the functions that manipulate them.
Encapsulation also leads to data abstraction or hiding. Using Encapsulation also hides the data. In the previous example, the data of any of the sections like sales, finance, or accounts are hidden from any other area.
Inheritance is the process in which two classes have a relationship with each other, and objects of one class acquire properties and features of the other class. The class which inherits the features is known as the child class, and the class whose features it inherited is called the parent class.
The word polymorphism means having many forms. It is the ability to take more than one form. It is a feature that provides a function or an operator with more than one definition. It can be implemented using function overloading, operator overload, function overriding, virtual function. An operation may show off different behaviors at different times.