1
00:00:02,010 --> 00:00:02,670
Hello everyone.

2
00:00:02,670 --> 00:00:07,040
So in the last session we discussed what is different decks for using inheritance.

3
00:00:07,050 --> 00:00:08,610
I hope that part is clear.

4
00:00:08,610 --> 00:00:09,540
Now let's see the code

5
00:00:13,260 --> 00:00:14,570
so outline number 28.

6
00:00:14,600 --> 00:00:17,120
I am creating the object of the correctness.

7
00:00:17,130 --> 00:00:18,180
Okay so what will happen.

8
00:00:18,180 --> 00:00:23,490
So this is our weekly class and these are some of the properties.

9
00:00:23,520 --> 00:00:26,130
So at this land line number 28 what will happen.

10
00:00:26,130 --> 00:00:31,520
Default construct of the class will be called which will initialize the properties of difficult class.

11
00:00:31,620 --> 00:00:32,580
No doubt.

12
00:00:32,700 --> 00:00:36,030
Now line number twenty three I'm creating the object of got class.

13
00:00:36,040 --> 00:00:40,920
Now God is a special class white especially because it innate from difficult class.

14
00:00:40,920 --> 00:00:51,390
Okay so this is our card class and inside the god class we have some part of difficult class and some

15
00:00:51,390 --> 00:00:53,160
god specific properties.

16
00:00:53,160 --> 00:00:58,940
So the parties we have color and we have them ties.

17
00:00:59,220 --> 00:01:02,670
The third property which is the Mexican property will not be inherited.

18
00:01:03,030 --> 00:01:10,200
Okay so for creating the object of the Card class we have to create this vehicle class for creating

19
00:01:10,200 --> 00:01:11,170
kind of class object.

20
00:01:11,480 --> 00:01:11,950
Okay.

21
00:01:12,060 --> 00:01:16,710
So before greeting card class object we have to create this vehicle class object.

22
00:01:16,710 --> 00:01:21,090
So we have to initialize all those properties that are accessible to the car.

23
00:01:21,090 --> 00:01:31,570
Class Okay so when we write Ghazi so as soon as as soon as we create this kind of class object then

24
00:01:31,570 --> 00:01:36,720
first of all the color class constructed will be called okay.

25
00:01:36,770 --> 00:01:40,460
It will be called automatically it will be implicitly called okay.

26
00:01:40,520 --> 00:01:48,660
And then the guide class may be called Okay so via the victim class will be called first because first

27
00:01:48,690 --> 00:01:57,110
we have to create this part then only we can create this outer block in the memory okay.

28
00:01:57,130 --> 00:02:03,610
So when we write Ghazi see what will happen first the vehicle class constructor will be called so that

29
00:02:03,610 --> 00:02:04,720
we can initialize.

30
00:02:04,720 --> 00:02:09,820
We can create this part in the memory then that kind of constructor will be called so that we can create

31
00:02:09,850 --> 00:02:12,100
this outer block in the memory.

32
00:02:12,490 --> 00:02:13,010
Okay.

33
00:02:13,180 --> 00:02:20,780
So what do we the order of calling constructor in case of inheritance.

34
00:02:20,810 --> 00:02:24,470
So what will be the order of calling a strict linkage of inheritance.

35
00:02:24,470 --> 00:02:33,860
Suppose we have three classes Glass a class we inherited from Class A and glossy inherited from Class

36
00:02:33,860 --> 00:02:34,610
B.

37
00:02:34,700 --> 00:02:40,150
So if I create an object of Class E E then what will happen.

38
00:02:40,400 --> 00:02:42,990
Only the E class constructor will be called.

39
00:02:43,030 --> 00:02:51,890
Okay so this is a and it has some properties so only the E Class constructively because called no doubt.

40
00:02:51,900 --> 00:02:56,770
Now if I create the object of Class B then what will happen.

41
00:02:56,790 --> 00:03:05,600
So this is destructive for Class B it contains e and some B specific properties then first of all what

42
00:03:05,600 --> 00:03:06,700
will happen.

43
00:03:07,040 --> 00:03:11,910
Constructor it will be called and then construct the B will be called.

44
00:03:12,150 --> 00:03:17,300
Okay so first a class constructed with regard then because constructively with class because first we

45
00:03:17,300 --> 00:03:22,570
have to create this part then we can create the outer part.

46
00:03:22,580 --> 00:03:23,210
Okay.

47
00:03:23,360 --> 00:03:27,890
Now if I create the object of C class then what will happen.

48
00:03:27,890 --> 00:03:38,580
First of all this is the structure of class C it contains B and some C specific properties and B contains

49
00:03:38,640 --> 00:03:41,640
a and b specific properties.

50
00:03:41,970 --> 00:03:46,150
So first of all we have to create a So E class constructor will be called.

51
00:03:46,350 --> 00:03:48,870
Then we have to create B.

52
00:03:48,870 --> 00:03:52,800
So this B class constructor will be called and at last.

53
00:03:52,800 --> 00:03:55,570
This C class constructed will be called.

54
00:03:55,570 --> 00:04:01,010
Okay so I hope that you now understand the order of calling constructors in case of inheritance.

55
00:04:01,080 --> 00:04:04,140
Okay now let us verify our statement.

56
00:04:04,140 --> 00:04:05,030
So let's in

57
00:04:09,360 --> 00:04:16,110
Okay so let's make some constructors so I am creating a default constructor.

58
00:04:16,190 --> 00:04:23,440
Okay so default we could construct that and now inside the constructor let's create something see out

59
00:04:24,620 --> 00:04:26,210
the default construct that

60
00:04:31,620 --> 00:04:40,180
and now let us also create the default their default destructor for vehicle class.

61
00:04:40,270 --> 00:04:46,610
Okay so a special symbol and vehicle the go district.

62
00:04:46,720 --> 00:04:46,970
Okay

63
00:04:51,920 --> 00:04:53,630
and now let's do the same for God.

64
00:04:53,630 --> 00:05:01,220
Class also Okay so we will create the god class default constructor and district in constructor.

65
00:05:01,220 --> 00:05:01,580
Okay.

66
00:05:01,580 --> 00:05:09,300
So God now let us bring something C out.

67
00:05:09,460 --> 00:05:10,740
Car default constructed

68
00:05:19,280 --> 00:05:21,500
and now let us all to create the destructor.

69
00:05:21,520 --> 00:05:21,740
Okay

70
00:05:31,810 --> 00:05:40,210
okay so we have because class default constructed and destructor similarly called class or default constructor

71
00:05:40,240 --> 00:05:43,310
and destructor okay.

72
00:05:43,400 --> 00:05:45,340
Now what will happen.

73
00:05:48,270 --> 00:05:50,820
So add this line what will happen.

74
00:05:50,820 --> 00:05:53,490
So v class default constructor will be called.

75
00:05:53,520 --> 00:05:57,640
Okay so we call class default constructor will be called and add this line.

76
00:05:57,690 --> 00:06:04,140
Gotta see what will happen first the vacate class default construct that will be called and then the

77
00:06:04,140 --> 00:06:04,440
car.

78
00:06:04,440 --> 00:06:07,020
Class default constructor will be called.

79
00:06:07,110 --> 00:06:10,920
Okay now let's run this file to see the output.

80
00:06:10,940 --> 00:06:12,710
Now let's come and everything out

81
00:06:19,540 --> 00:06:21,920
okay so we call V and Ghazi.

82
00:06:21,970 --> 00:06:22,900
Now let's add this file

83
00:06:26,920 --> 00:06:27,190
okay.

84
00:06:27,200 --> 00:06:32,350
Now let us try to analyze what is the output.

85
00:06:32,440 --> 00:06:36,150
So first the vocal class constructor will be called.

86
00:06:36,190 --> 00:06:39,520
Now this construct based being called for creating the VK class object.

87
00:06:39,550 --> 00:06:43,660
Okay so this first output is due to be called class.

88
00:06:43,660 --> 00:06:46,690
Now the second output is we are creating the called Class object.

89
00:06:46,960 --> 00:06:52,550
So first the vehicle default constructor will be called then called constructor will recall.

90
00:06:52,550 --> 00:06:56,050
Okay so the first line is do you do the class.

91
00:06:56,060 --> 00:07:01,610
Now the next two line are due to Card class and the order for District is just opposite the order of

92
00:07:01,610 --> 00:07:02,610
the inheritance.

93
00:07:02,630 --> 00:07:07,040
So first the card destructively McCall then the school district.

94
00:07:07,070 --> 00:07:09,240
So these are due to go out of class.

95
00:07:09,290 --> 00:07:12,730
And the last line it is due to the class.

96
00:07:12,740 --> 00:07:17,930
Okay so the order of district Burke called is just the opposite of the inheritance.

97
00:07:18,980 --> 00:07:24,610
Okay so the first line this is due to class the next to line.

98
00:07:24,680 --> 00:07:26,030
This is due to card class.

99
00:07:26,060 --> 00:07:29,440
Again the next two line are due to card class destructor.

100
00:07:29,540 --> 00:07:32,350
And the last line is due to the class destructor.

101
00:07:33,230 --> 00:07:38,600
Okay so the order for District based oppose it off the order of the inheritance.

102
00:07:38,600 --> 00:07:39,160
Okay.

103
00:07:39,260 --> 00:07:40,640
Now what is happening here is

104
00:07:45,630 --> 00:07:54,350
so had this line implicitly what happens is it is something like this so we have started about initialization

105
00:07:54,350 --> 00:07:55,300
list.

106
00:07:55,490 --> 00:08:00,980
So what is happening here is when we are writing code to see what will happen it will call its default

107
00:08:00,980 --> 00:08:01,910
constructor.

108
00:08:02,030 --> 00:08:08,950
So when we will reach this default construct but it is implicitly something like this initialization

109
00:08:08,950 --> 00:08:09,480
list.

110
00:08:09,520 --> 00:08:09,780
Okay.

111
00:08:09,790 --> 00:08:10,810
So what will happen.

112
00:08:10,900 --> 00:08:13,040
What is the use of initialization list.

113
00:08:13,090 --> 00:08:20,000
So before entering this constructor before reaching line number 29 we will go to the vehicle construct.

114
00:08:20,020 --> 00:08:24,420
Okay so that's why this code is getting printed first.

115
00:08:24,550 --> 00:08:28,000
This called the default construct is getting printed first.

116
00:08:28,030 --> 00:08:35,380
Okay so okay so implicitly this is something like this but you do not need to write this here because

117
00:08:35,860 --> 00:08:39,230
the vehicle class default construct it is called implicitly okay.

118
00:08:39,250 --> 00:08:42,790
This call automatically so we don't need to write this.

119
00:08:42,790 --> 00:08:43,510
Okay.

120
00:08:43,540 --> 00:08:48,750
Now what will happen if I create a better mid priced vehicle constructor.

121
00:08:48,790 --> 00:08:57,830
Okay so we have a better motorized vehicle constructor it takes an argument Lex's ID and what it does

122
00:08:57,830 --> 00:09:03,220
is Max speed is Z.

123
00:09:03,470 --> 00:09:03,800
Okay.

124
00:09:03,800 --> 00:09:05,070
So what will happen now.

125
00:09:06,110 --> 00:09:12,650
Okay so what happened is so when we write Ghazi what will happen.

126
00:09:12,690 --> 00:09:16,300
It will call their default constructor of the vehicle class.

127
00:09:16,410 --> 00:09:16,800
Okay.

128
00:09:16,890 --> 00:09:20,670
So always the default constructed will be called automatically.

129
00:09:20,880 --> 00:09:25,320
Okay but if we want to call the betterment based construct of the vehicle class then we have to call

130
00:09:25,410 --> 00:09:27,140
explicitly okay.

131
00:09:27,330 --> 00:09:31,320
I'm repeating myself when we write Ghazi what it will do.

132
00:09:31,320 --> 00:09:36,980
It will call the default constructor of the vehicle class.

133
00:09:37,300 --> 00:09:44,430
But now what I want is I have a better memorized constructor parameter traced the call constructor and

134
00:09:44,640 --> 00:09:51,140
I want to call this better my place constructor I want to call this better taste construct better.

135
00:09:51,140 --> 00:09:54,060
So what we have to do we have to call explicitly

136
00:09:56,640 --> 00:10:00,320
and this is implicitly we don't need to write anything.

137
00:10:00,360 --> 00:10:05,950
This will recall implicitly but for calling the paramedics constructor we have to call explicitly.

138
00:10:06,000 --> 00:10:12,300
So what is this index so in Texas very simple we will write God C then with the help of initialization

139
00:10:12,300 --> 00:10:14,320
list we call.

140
00:10:14,580 --> 00:10:19,600
And since it takes only one argument so we will give one argument okay.

141
00:10:19,710 --> 00:10:21,900
And that's all okay.

142
00:10:21,910 --> 00:10:26,600
So this is just an index for calling the betterment days constructed.

143
00:10:26,920 --> 00:10:27,570
Okay.

144
00:10:27,670 --> 00:10:35,920
And for default construct this index is very simple Ghazi and simple we call okay.

145
00:10:36,020 --> 00:10:39,570
But in case of default we do not need to write this.

146
00:10:39,650 --> 00:10:48,300
Okay now let us call the param at base constructor so I want to call this better my test constructor.

147
00:10:48,340 --> 00:10:51,130
So I have to pass a value let's say 5.

148
00:10:51,850 --> 00:10:52,150
Okay.

149
00:10:52,180 --> 00:10:53,470
Now this is correct.

150
00:10:53,590 --> 00:10:57,960
Okay print something so that we can verify.

151
00:10:58,060 --> 00:11:04,530
So we'll see out we call barometer based constructor

152
00:11:10,540 --> 00:11:11,290
okay.

153
00:11:11,470 --> 00:11:13,580
So now let us comment out everything.

154
00:11:13,600 --> 00:11:15,600
So to avoid any confusion.

155
00:11:15,640 --> 00:11:17,670
So we have only got to see here.

156
00:11:18,560 --> 00:11:23,800
Now we will try to analyse for boolean output so Ghazi see will.

157
00:11:23,810 --> 00:11:30,020
We will reach here Ghazi and in the initialization list we are calling the better metrics constructor

158
00:11:31,040 --> 00:11:32,240
of the weekly class.

159
00:11:32,240 --> 00:11:33,610
So we will reach here.

160
00:11:33,740 --> 00:11:39,710
So the output will be we call a paramedic based constructor and then got a default constructor.

161
00:11:40,210 --> 00:11:40,480
Okay.

162
00:11:40,490 --> 00:11:42,030
So this will be our output.

163
00:11:42,170 --> 00:11:47,030
And then the order of district pay is just the opposite of the order of inheritance.

164
00:11:47,150 --> 00:11:47,750
Okay.

165
00:11:47,810 --> 00:11:49,040
So now let us turn our file

166
00:11:53,590 --> 00:11:59,980
okay so we can see here is we call paramedics construct a card then card default construct a card and

167
00:12:00,030 --> 00:12:02,710
our district pays deposit first.

168
00:12:02,890 --> 00:12:07,650
The car will be destroyed and then the vehicle will be destroyed okay.

169
00:12:08,150 --> 00:12:12,730
So everything is running fine okay.

170
00:12:12,780 --> 00:12:15,780
So now let's take more examples.

171
00:12:15,780 --> 00:12:16,510
Okay.

172
00:12:16,710 --> 00:12:19,710
So okay let's remove this

173
00:12:23,080 --> 00:12:27,030
and now let us also commend the vehicle default constructor.

174
00:12:27,160 --> 00:12:27,430
Okay

175
00:12:30,680 --> 00:12:33,980
so I'm commenting out we a default constructor.

176
00:12:34,160 --> 00:12:34,720
Okay.

177
00:12:34,730 --> 00:12:40,300
So now their default construct of the vehicle class is not visible since we have created our own betterment

178
00:12:40,310 --> 00:12:41,210
based construct.

179
00:12:42,050 --> 00:12:42,310
Okay.

180
00:12:42,320 --> 00:12:47,010
I'm repeating myself since we have created our own betterment based construct that the vehicle.

181
00:12:47,010 --> 00:12:50,600
Class default construct is not visible to us any.

182
00:12:50,630 --> 00:12:51,670
Now what will happen.

183
00:12:51,710 --> 00:12:54,540
Can we create our class object now.

184
00:12:54,620 --> 00:12:56,180
So will this line work.

185
00:12:56,250 --> 00:13:02,540
Ghazi will it work on artwork so the output is it will not work.

186
00:13:02,810 --> 00:13:03,180
Okay.

187
00:13:03,830 --> 00:13:07,670
So let us in this file so we will get an added.

188
00:13:07,830 --> 00:13:11,880
And now let us try to analyze what is the advice you are getting an added.

189
00:13:11,880 --> 00:13:12,170
Okay

190
00:13:16,630 --> 00:13:20,600
so when we write Ghazi what it will do.

191
00:13:20,800 --> 00:13:25,720
It will try to call the default constructor of the because class and their default construct of the

192
00:13:25,730 --> 00:13:30,370
vehicle class is not there because we have created our own parameters constructor.

193
00:13:30,460 --> 00:13:32,370
So this line is wrong.

194
00:13:32,410 --> 00:13:33,960
This line will throw us at it.

195
00:13:34,060 --> 00:13:36,330
So we cannot create objects of the car class.

196
00:13:36,360 --> 00:13:36,640
No.

197
00:13:37,250 --> 00:13:39,010
Okay so what we have to do.

198
00:13:39,190 --> 00:13:40,990
So here we have a compulsion.

199
00:13:41,140 --> 00:13:41,370
Okay.

200
00:13:41,380 --> 00:13:47,170
So now in order to create a guide class object there is a compulsion now that we have to call the parametric

201
00:13:47,200 --> 00:13:50,830
constructor or difficult class because the default one is not visible.

202
00:13:51,220 --> 00:13:51,810
Okay.

203
00:13:52,060 --> 00:13:57,300
So here we have a compulsion in order to create the object of the second class.

204
00:13:57,310 --> 00:14:03,430
We have to call the paramedics constructor or difficult class because the default construct of difficult

205
00:14:03,450 --> 00:14:05,650
classes not there.

206
00:14:05,650 --> 00:14:06,280
Okay.

207
00:14:06,280 --> 00:14:09,950
Now disconnect correct if you will render a file you will not get any added.

208
00:14:10,710 --> 00:14:13,750
Okay so our code is working without any errors.

209
00:14:13,750 --> 00:14:14,020
Okay.

210
00:14:14,020 --> 00:14:15,890
Now this is not the right way.

211
00:14:15,910 --> 00:14:17,140
So what is the right way.

212
00:14:17,170 --> 00:14:23,300
So that I ways first we will take the input and then we will pass the X here.

213
00:14:23,380 --> 00:14:23,800
Okay.

214
00:14:23,920 --> 00:14:25,170
So this is the right way.

215
00:14:25,210 --> 00:14:31,270
Now if you will write Ghazi we have to change this also because Ghazi will call the default constructor

216
00:14:31,450 --> 00:14:36,520
and we do not have default constructor we have better my taste this is now a paramedic's constructor.

217
00:14:36,520 --> 00:14:37,600
So let us change

218
00:14:42,720 --> 00:14:48,480
okay so we cannot create objects like this because we do not have a default constructor because we we

219
00:14:48,480 --> 00:14:50,870
have created our own parameters constructor.

220
00:14:50,970 --> 00:14:57,530
So in order to create the object we have to pass a value we have to call paramedics constructor.

221
00:14:57,630 --> 00:14:59,360
Okay now let's on this file

222
00:15:02,370 --> 00:15:04,080
okay so everything is working fine.

223
00:15:04,320 --> 00:15:04,980
Okay.

224
00:15:05,010 --> 00:15:07,120
Also no let us try to analyze the output.

225
00:15:07,200 --> 00:15:12,360
So first the vehicle class better my desk constructor will be called then God better my test constructively

226
00:15:12,360 --> 00:15:14,870
be called and then the order of District based deposit.

227
00:15:14,910 --> 00:15:17,670
Okay okay.

228
00:15:17,680 --> 00:15:27,010
So now let us take one more example so now let us create another class Gaussian density okay.

229
00:15:27,090 --> 00:15:34,910
So this class from the city let us and headed this class in that it's from the court class.

230
00:15:34,920 --> 00:15:42,070
Okay now let us also create its gastric band destructor okay

231
00:15:53,040 --> 00:15:54,190
city constructed

232
00:16:01,010 --> 00:16:01,480
unnecessary.

233
00:16:01,500 --> 00:16:03,510
The forward concept is better.

234
00:16:03,540 --> 00:16:10,810
Okay so let's leave it you deconstruct only and it will also create or unnecessary destructor

235
00:16:25,040 --> 00:16:25,610
okay.

236
00:16:25,630 --> 00:16:28,340
So now we have T levels of inheritance.

237
00:16:28,350 --> 00:16:28,700
No.

238
00:16:28,990 --> 00:16:29,290
Okay

239
00:16:32,690 --> 00:16:40,010
so what we have is we have this little glass God glass inherits from the victim glass and there are

240
00:16:40,030 --> 00:16:43,630
only 30 glass inherits from the car glass.

241
00:16:43,640 --> 00:16:45,870
Okay so three levels of inheritance is there.

242
00:16:45,870 --> 00:16:46,160
No.

243
00:16:46,820 --> 00:16:47,330
Okay.

244
00:16:47,330 --> 00:16:49,820
So when we create the audacity object.

245
00:16:49,940 --> 00:16:50,900
So if I write

246
00:16:53,670 --> 00:16:57,020
letter at the edge then what will happen.

247
00:16:57,020 --> 00:16:59,500
First of all it will call.

248
00:16:59,600 --> 00:17:02,330
So what will be the order of inheritance.

249
00:17:02,330 --> 00:17:02,860
Okay.

250
00:17:02,900 --> 00:17:09,830
So first the victim class object will be called the class will be called then the car class construct

251
00:17:09,830 --> 00:17:12,800
that will be called and then the university construct that will be called.

252
00:17:12,830 --> 00:17:14,380
So this will be the order.

253
00:17:14,390 --> 00:17:19,510
Now what will happen when we write this object on the city edge what it will do.

254
00:17:19,670 --> 00:17:20,660
It will reach here.

255
00:17:20,750 --> 00:17:23,090
Line number 48 and implicitly what will happen.

256
00:17:23,090 --> 00:17:25,100
Got a class default constructor will be called.

257
00:17:25,580 --> 00:17:26,280
Okay.

258
00:17:26,570 --> 00:17:33,440
So we will call God class default constructor and God class default constructor is not visible to us.

259
00:17:33,590 --> 00:17:33,890
Why.

260
00:17:33,920 --> 00:17:38,040
Because we have created betterment based constructor so we will get an added.

261
00:17:38,060 --> 00:17:44,030
Okay so this line will throw at it why it will throw at it because the car class default constructor

262
00:17:44,030 --> 00:17:47,390
will be called and the car class default constructor is not there.

263
00:17:47,870 --> 00:17:53,220
Okay let's see dieted Okay so let's come and out everything.

264
00:17:55,970 --> 00:18:00,690
So we are creating an object of unnecessary.

265
00:18:00,820 --> 00:18:05,100
So what it will do we will reach this line for dessert.

266
00:18:05,110 --> 00:18:09,850
It will call the car last default constructor and the Goddard class default construct based not there.

267
00:18:09,910 --> 00:18:10,300
Right.

268
00:18:10,300 --> 00:18:15,560
We call car class default constructor because implicitly default constructor is called.

269
00:18:15,670 --> 00:18:16,190
Okay.

270
00:18:16,300 --> 00:18:17,430
So we will get an idea.

271
00:18:17,560 --> 00:18:17,990
Okay.

272
00:18:19,660 --> 00:18:22,800
So we are getting an added now in order to resolve this error.

273
00:18:22,810 --> 00:18:26,180
What we have to do since we only have better my constructor.

274
00:18:26,290 --> 00:18:28,510
So we have to call this better my test constructor.

275
00:18:28,510 --> 00:18:33,040
Now there is a compulsion here we have to use the initialization list.

276
00:18:33,370 --> 00:18:36,690
So God 5 in order to call the paramedics constructor.

277
00:18:37,270 --> 00:18:39,750
Okay so now it will work.

278
00:18:39,820 --> 00:18:43,980
Okay now we have to explicitly call paramedics constructor.

279
00:18:43,990 --> 00:18:45,130
Now let's add in this file

280
00:18:49,080 --> 00:18:55,380
okay so what is happening here is this is daughter first that we could last better my test constructor

281
00:18:55,440 --> 00:19:00,780
then guided by my place constructor and the whole city construct and the order of District based deposit.

282
00:19:00,840 --> 00:19:08,070
Okay so everything is running fine now if I want to pass parameters.

283
00:19:08,440 --> 00:19:20,020
Suppose I want to pass barometers so God and anyway so X will go to the victim class and for Y what

284
00:19:20,020 --> 00:19:22,900
we are planning to use here is the let's say number of gears

285
00:19:26,780 --> 00:19:29,860
number of gears is Y Okay.

286
00:19:30,210 --> 00:19:35,700
Now what will happen here is since the car class is now taking two arguments has input.

287
00:19:36,080 --> 00:19:39,750
So let's see this is ridiculous.

288
00:19:39,780 --> 00:19:46,760
It takes two arguments x and y okay because the car class constructor takes two arguments so we'll pass

289
00:19:46,790 --> 00:19:49,750
X and we will pass Y Okay.

290
00:19:49,850 --> 00:19:55,340
Now for creating the horn that's the object we cannot create object like this because it will call the

291
00:19:55,340 --> 00:20:00,470
default concept then default construct is not dead because it's a paramedic's constructor No.

292
00:20:00,500 --> 00:20:06,050
Okay so we have to call better my test constructor we have to pass two values use every possible values

293
00:20:06,410 --> 00:20:09,960
lecture two values that four and five okay.

294
00:20:10,150 --> 00:20:13,390
So what will happen better my desk and said I will be called.

295
00:20:13,420 --> 00:20:17,920
So it will reach here X and Y will be passed to the god class parameters constructor.

296
00:20:17,980 --> 00:20:21,240
So a number of games that way and it will pass x.

297
00:20:21,400 --> 00:20:27,910
So from here we will reach the vehicle class and first of all because last better make this constructor

298
00:20:27,960 --> 00:20:33,830
called then God class Parramatta's constructor called and then the homeless you deconstruct the code

299
00:20:33,910 --> 00:20:35,130
so this will be our output.

300
00:20:35,230 --> 00:20:36,540
Okay next on this file

301
00:20:40,700 --> 00:20:40,990
okay.

302
00:20:41,030 --> 00:20:46,070
So first of all we get class paramedic's constructor then God and then horn deputy and the District

303
00:20:46,070 --> 00:20:47,310
based just the opposite.

304
00:20:47,570 --> 00:20:53,360
Okay so when lasting so one last thing is.

305
00:20:53,360 --> 00:20:58,610
So we have this weekly class called Class in added from the working class and the whole industry to

306
00:20:58,610 --> 00:21:02,210
cut down this class inherits from the car class.

307
00:21:02,210 --> 00:21:02,870
Okay.

308
00:21:02,870 --> 00:21:06,490
So a class can only call the constructor of its immediate parent.

309
00:21:06,650 --> 00:21:07,300
Okay.

310
00:21:07,340 --> 00:21:11,410
A class can only call the constructor of its immediate appearance.

311
00:21:11,450 --> 00:21:13,220
So this is right.

312
00:21:13,220 --> 00:21:22,190
And this is wrong okay our class can only call the concept of its immediate parent.

313
00:21:22,720 --> 00:21:23,300
Okay.

314
00:21:23,380 --> 00:21:29,050
Similarly our class can call the construct of the working class but don't assume the class cannot call

315
00:21:29,200 --> 00:21:31,490
the constructor of the working class.

316
00:21:31,540 --> 00:21:33,180
Okay so that's all from my side.

317
00:21:33,190 --> 00:21:33,610
Thank you.
