Multilevel Inheritance

Multilevel inheritance :

multilevel inheritance
  • When a class inherits a class that already inherits any other class, is called multilevel inheritance
  • Here, class C inherits class B and class B inherits class A.
  • Whenever an object is created, constructor is firstly called for top level class
  • When an object for class C is created, constructor is called for class A first ,then class B ,then class C.
Following program illustrates a multi-level inheritance in C++ :


OUTPUT :

Leave a Reply

Your email address will not be published. Required fields are marked *