Up until this point, we have got the idea about inheritance. Now, it's time to discuss inheritance types; inheritance is of the following types:
- Single inheritance:
This is a widely used type of inheritance. Single inheritance is when a class inherits another class. A class that inherits another class is called a child class and the class which is being inherited is called a parent or base class. In the child class, the class inherits features from one parent class only.
You can inherit classes hierarchically (as we will see in the following section), but that is a single inheritance in nature for a derived class. Refer the following diagram:
The preceding diagram is a representation ...