What is inheritance in Java?

DWQA QuestionsCategory: QuestionsWhat is inheritance in Java?
Editor Staff asked 4 weeks ago

What is inheritance in Java?

1 Answers
Editor Staff answered 4 weeks ago

The process by which one class acquires the properties(data members) and functionalities(methods) of another class is called inheritance. The aim of inheritance is to provide the reusability of code so that a class has to write only the unique features and rest of the common properties and functionalities can be extended from another class.
Child Class:
The class that extends the features of another class is known as child class, sub class or derived class.
Parent Class:
The class whose properties and functionalities are used(inherited) by another class is known as parent class, super class or Base class.