Class
Inheritance
In class inheritance, a
new class can be derived or inherited from an existing base or a parent class.
The new (or derived or child) class will then inherit all members of the
existing parent class. The derived class acts as a subtype of the base class.
Objects of the derived class can be assigned to a variable of the parent class
using pointers and references. Class hierarchy is a pictorial view of all the
sub-classes along with their parent classes.