Back to Browse

Hierarchical Inheritance

61 views
Oct 15, 2019
12:19

In this tutorial we will implement hierarchical inheritance Single inheritance where subclasses inherit the features of one superclass. A class acquires the properties of another class. Multiple inheritance where one class can have more than one superclass and inherit features from all parent classes. Multilevel inheritance where a subclass is inherited from another subclass. It is not uncommon that a class is derived from another derived class as shown in the figure "Multilevel inheritance". Hierarchical inheritance This is where one class serves as a superclass (base class) for more than one sub class. For example, a parent class, A, can have two subclasses B and C. Both B and C's parent class is A, but B and C are two separate subclasses. Hybrid inheritance Hybrid inheritance is when a mix of two or more of the above types of inheritance occurs. An example of this is when class A has a subclass B which has two subclasses, C and D. This is a mixture of both multilevel inheritance and hierarchal inheritance.

Download

0 formats

No download links available.

Hierarchical Inheritance | NatokHD