First, let us define some fundamentals required to understand a few concepts of oops.
Example: Math object
An object-oriented programming language provides developers with four capabilities:
Inheritance is the ability of a class(class A) to acquire the properties another class(class B). Here class A is referred to as the child class and class B is regarded as the parent class. The child class inherits all the methods defined in the parent.
Even though the child class can use the inherited methods, it does not need to know the inner working of those methods. Unless we need to change the operation, we do not need to define the method in the child class explicitly.
Abstraction is the ability of the language to hide most of the details only to show the essential features of the project. Hence, Abstraction improves the understandability and the readability of the code. We apply abstraction in java using prototypes.