 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can implement default constructor in hierarchical inheritance in C++. Before starting, you can note my information. You can follow my YouTube channel that is sanjaygupta underscore tax school. You can download my app TechMS that is available on Google Play. This app is related to various programming languages. Now coming on to the topic. For demonstration purpose, I have implemented a code that is implementing hierarchical inheritance along with default constructor. So a header file is included. Then STD namespace is used. Then I have implemented a class A and inside this class, I have implemented default constructor. Inside default constructor a message constructor of class A is available with C out. So this A class is base class. This base class is inherited into B class. So B is derived class. In case of hierarchical inheritance, one base class can be inherited by multiple derived classes. So here B is derived class for A class. Then derived class constructor is available here. Now class C is defined, which is also inheriting class A. So class A is base class for both B and C. Now C class constructor is defined, which will display message constructor of class C on console. Right now I have two derived classes B and C. So inside main method, I have to create object of both the classes. So first I am creating object of B class and then object of C class. And both objects first calls their own classes and then base class. So you have to remember that order of calling of constructors derived class to base class. So if we take the example of this OBJ1. So this OBJ1 will call the constructor of class B first and then class A. And this OBJ2 will call constructor of class C first and then class A. But order of execution of constructor is base to derived class. So first base class constructor that is A will be executed and then B or C class constructor will be executed as per their object. So now I am going to execute this code. You can see the output creating class B object. So it is displaying constructor of class A, constructor of class B, then creating class C object. Again you can see class A constructor is called and then class C constructor is called. So I hope you have understood how we can implement default constructor in hierarchical inheritance. If you want to watch more programming related videos, you can follow my YouTube channel that is Sanjay Gupta underscore tech school. You can download my app Techimus that is based on programming languages and it is available on Google Play. Thank you for watching this video.