October 2018
Intermediate to advanced
370 pages
9h 15m
English
When a class is derived from a class that is already derived from another class, this inheritance is called multilevel inheritance. This refers to a situation where at least one class has more than one parent class. As we can see in the following diagram, B is derived from A, and C is derived from B. C not only contains the properties and behaviors of B, but also from class A, as well as its own. Let's create a superclass, Person, a derived class, Employee, and another derived class, Programmer:

The Person class contains one property, name, and two behaviors, sleep and speak. The Employee class inherits everything from ...
Read now
Unlock full access