 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can use parametrize constructor in inheritance in Java. Before starting, you can note my information which is available in front of you. You can subscribe my YouTube channel by clicking on the link which is appeared at bottom right corner of this video. You can download my app Techimus that is available on Google Play. Now coming on to the topic, I have implemented a code for demonstrating the use of parametrize constructor in inheritance. You can see class A which is having an attribute X. This is constructor of class A that is parametrize constructor. It is receiving a value inside A that value is assigned into X. Then show method which will show inside A and value of X on console. After implementation of class A, class B is defined. Class B is inheriting class A. It is having an attribute that is Y. Then it is constructor which is parametrize constructor. This constructor is receiving two values inside A and B. With the help of this super, value of A is passed to superclass that is A and value of B is used inside subclass into Y which is declared in B class. So friends, if you want to pass information to superclass, then you can use super. If you want to use information inside subclass, then you don't have to use anything. You can simply assign value into the variable. Now show method. It is calling show of superclass first and then with the help of system.out.println statement inside B and value of Y will be displayed on console. So this parametrize constructor of subclass is linked with a parametrize constructor of superclass with the help of super and show method of subclass is also linked with show method of superclass with this statement. Now third class is test which is defining main method. Inside main method an object is created of B class. So when this object will be created, two values 10 and 20 will be passed into subclass constructor. So friends, here you have to remember that control will be transferred to subclass constructor first and then it will transfer control to superclass. Then superclass constructor will execute first and then subclass. Then obj.show this calling statement will call show method of subclass. Then inside show method of subclass super.show is called which will call show method of superclass. So in both cases constructor and function execution of superclass will be done first and then execution of subclass will be done second. Now I am executing this code. You can see the output inside a value of X equals to 10 is displayed first inside B and value of Y equals to 20 is displayed after the output of superclass. This way you can implement parametrize constructor in inheritance. Remember that parametrize constructor of subclass is responsible for passing values into superclass constructor because whenever we create object of subclass, constructor of subclass is called first. So it is responsible for passing values to superclass. And if you want to call methods of superclass inside subclass methods, then you can use super keyword. This way you can implement parametrize constructor in inheritance in Java. Implement this code at your own so that you can understand the working of a parametrize constructor in Java. If you want to watch more programming related videos, you can subscribe my YouTube channel. You can connect with me by following these details which are available in front of you. Thank you for watching this video.