Inheritance is the process, where one class inherits the properties of the another class.
The class which inherits the properties is known as derived class or sub-class or child class and the class from which the properties are inherited is known as base class or super class or parent class.
It represents 'IS-A' relationship.
Inheritance is used for code reusability.
The extends keyword is used to inherit the class properties.
Let's take an example and understand it in detail.
In the above example, you can see that Dog class and Tiger class is extending Animal class. Here you can also see the 'IS-A' relationship.
Dog IS-A Animal
Tiger IS-A Animal
Types of Inheritance
Following are the types of inheritance.