 Hello friends, I am Sanjay Gupta. In this video I am going to demonstrate you how you can implement parametrized constructor in single inheritance in C++. Before starting, you can note my information. You can follow my YouTube channel that is Sanjay Gupta underscore tax school. You can download my app Techimage that is available on Google Play. Now coming on to the topic. For demonstration purpose I have implemented a code in front of you. Here I have included a header file IO stream. Then STD namespace is used. Then I have first implemented class A, which is base class here. It has one attribute X. Then in public section, parametrized constructor is available. It is receiving value inside variable A. Then a message constructor of class A will be displayed. Value of A is assigned into X. Then show method which will display value of X on console. After implementation of A, B class is implemented. Here B class is derived class and A is base class. So B class is having one attribute that is Y. Then its parametrized constructor is defined, which is receiving two arguments A and B. And it is passing one value inside base class. So here I am passing B as a base class argument and I am using A as derived class argument and A is assigned into Y and this B will be passed inside this A and that will be assigned into X. So base class parameter is receiving value of B and derived class parameter is receiving value of A. This concept is also known as explicit invocation of base class constructor. So through derived class, we can pass arguments to base class but reverse is not possible. This is a reason. Order of calling of constructor is derived to base. So when I will be creating object of class B that is derived class, these two arguments will be passed to derived class constructor first. Then derived class constructor will be calling base class constructor and then arguments will be passed to base class constructor. When order of execution is required, then base class constructor will be executed first and then derived class constructor will be executed. In main function, you can see show function is also called which is defined here. It is derived class show method is calling show of base class and then it is printing Y. So this is the explanation of this code. I hope you have understood how parametrized constructors are linked in case of inheritance. Now I am executing this code. You can see the output constructor of class A then constructor of class B is printed. Value of X is 10 and Y is 5. So this B is receiving 10 that is passed from main. So 5 is passed into A which is received inside Y and 10 is passed into B which is further passed to base class and then assigned into X. So that's why X is 10 and Y is 5. Now I am passing A here and I am using B here. So this time you will see output will be swept. So X is printing 5 and Y is printing 10. But constructors are calling in same order first A and then B. So this way you can use parametrized constructor in single inheritance and I have also demonstrated how you can explicitly invoke base class constructor through derived class constructor. So I hope you have understood the concept of implementation of parametrized constructor in single inheritance. If you want to watch more programming related videos, you can follow my YouTube channel that is sanjagukta underscore tech school. You can download my app TechMS that is available on Google Play. Thank you for watching this video.