1
00:00:00,470 --> 00:00:03,300
And this is that this is more professional.

2
00:00:03,690 --> 00:00:09,390
And now let's actually override the twisting method that you actually inherit from the superclass.

3
00:00:09,540 --> 00:00:11,010
So what is the superclass.

4
00:00:11,010 --> 00:00:11,970
In this case.

5
00:00:11,970 --> 00:00:19,890
So as you know all classes in Java are explicitly or implicitly inherits all of the features and behaviors

6
00:00:19,890 --> 00:00:21,930
that are inside of the Object class.

7
00:00:21,960 --> 00:00:24,780
So he has this student student class as you can see here.

8
00:00:25,110 --> 00:00:30,750
Implicitly inherits all of the features and behaviors that are inside of the Object class.

9
00:00:30,750 --> 00:00:37,790
So here again just typing to string and here let's actually delete this line of code that are actually

10
00:00:37,800 --> 00:00:41,370
inside that is inside of these two string method.

11
00:00:41,370 --> 00:00:45,940
And now we can actually put in our own implementations inside of this posting method.

12
00:00:45,960 --> 00:00:51,090
Now I'm going to actually pasting a line of code here and then I'm going to explain to you what's going

13
00:00:51,090 --> 00:00:51,530
on here.

14
00:00:51,540 --> 00:00:51,900
OK.

15
00:00:51,930 --> 00:00:57,660
So here I am saying the return string data format and inside it up course as you can see I am specifying

16
00:00:57,660 --> 00:01:00,090
the formats of my string value.

17
00:01:00,120 --> 00:01:01,440
So this up.

18
00:01:01,440 --> 00:01:05,610
So this person as you can see here is for this name here as you can see.

19
00:01:05,610 --> 00:01:07,660
So a person as called space.

20
00:01:07,830 --> 00:01:11,980
And we have another person is here this tokin is for these kids name it.

21
00:01:12,030 --> 00:01:12,720
OK.

22
00:01:13,020 --> 00:01:14,920
And we have a person here.

23
00:01:15,030 --> 00:01:18,300
So this person is actually a newline character.

24
00:01:18,330 --> 00:01:18,840
OK.

25
00:01:18,950 --> 00:01:21,020
If we have another person here.

26
00:01:21,120 --> 00:01:24,250
So this person is for this course name here.

27
00:01:24,280 --> 00:01:25,100
OK.

28
00:01:25,430 --> 00:01:27,770
Call in space.

29
00:01:27,900 --> 00:01:33,220
And we have another person here and this person S is for this good course name here.

30
00:01:33,250 --> 00:01:39,780
OK so now let's actually go back inside this main activity that double file here and inside of these

31
00:01:40,170 --> 00:01:43,130
uncreate if it is actually putting our own coats here.

32
00:01:43,140 --> 00:01:43,530
OK.

33
00:01:43,620 --> 00:01:50,790
So first of all let's actually create an object from the text view class here as you can see here.

34
00:01:50,790 --> 00:01:53,950
I am actually creating an object from this textbook class.

35
00:01:53,970 --> 00:02:00,760
The polymorphism assignment operator and here I am saying find view by id r that ID data takes the polymorphism.

36
00:02:00,760 --> 00:02:09,090
OK so now let's actually create an array of type of life insurance objects as you can see here.

37
00:02:09,210 --> 00:02:13,860
This is a life insurance interface and inside of this main activity that have a fight and inside of

38
00:02:13,860 --> 00:02:18,600
this uncreate Smurfette all you want to actually create an array of type life insurance.

39
00:02:18,610 --> 00:02:23,460
So now I'm going to pasting some lines of code here and then I'm going to explain to you what's going

40
00:02:23,460 --> 00:02:24,390
on here.

41
00:02:24,930 --> 00:02:31,530
So here as you can see here first of all in 1919 I actually specify that I want to actually create an

42
00:02:31,530 --> 00:02:38,520
array of type life insurance as you can see the name the name of this era is life insurance's assignment

43
00:02:38,550 --> 00:02:39,180
operator.

44
00:02:39,270 --> 00:02:46,920
And here I want to instantiate this array by saying that this area can actually accept free objects

45
00:02:46,980 --> 00:02:48,570
of type life insurance.

46
00:02:48,570 --> 00:02:49,030
OK.

47
00:02:49,060 --> 00:02:54,380
And I agree that Chantry fair two are actually life insurance objects.

48
00:02:54,390 --> 00:02:54,790
OK.

49
00:02:54,870 --> 00:02:57,060
So the size of this area is free.

50
00:02:57,300 --> 00:02:58,560
OK.

51
00:02:58,570 --> 00:03:04,500
And here in line 20 as you can see for the index zero of this are a life insurance.

52
00:03:04,660 --> 00:03:06,290
You want to assign a value.

53
00:03:06,330 --> 00:03:06,900
OK.

54
00:03:07,170 --> 00:03:14,360
So life insurance is sub index zero assignment operator new student.

55
00:03:14,400 --> 00:03:18,620
So here I want to actually create an otter an object of type student.

56
00:03:18,720 --> 00:03:19,950
New students.

57
00:03:19,950 --> 00:03:26,340
So as you can see here inside of these students class as you can see this class because this class actually

58
00:03:26,430 --> 00:03:30,030
implements this life insurance interface.

59
00:03:30,030 --> 00:03:35,010
There is actually an ease our relationship between these two classes.

60
00:03:35,010 --> 00:03:38,150
So student is our life insurance.

61
00:03:38,160 --> 00:03:38,400
OK.

62
00:03:38,400 --> 00:03:45,570
There is actually an is a relationship between these two between these student class and this life insurance

63
00:03:45,780 --> 00:03:46,640
interface.

64
00:03:46,770 --> 00:03:53,080
That is and is our relationship between these two this student class and these are life insurance.

65
00:03:53,280 --> 00:03:53,970
OK.

66
00:03:54,210 --> 00:04:00,030
So let's go back inside the main activity that I will fight here and here I created an object of type

67
00:04:00,030 --> 00:04:06,260
student and here as you can see the constructor of this class is actually being called named John.

68
00:04:06,330 --> 00:04:08,490
John the name of the student is John.

69
00:04:08,520 --> 00:04:10,340
The course is Andrew devlopment.

70
00:04:10,530 --> 00:04:12,880
And here this is the cost of the life insurance.

71
00:04:12,910 --> 00:04:13,340
OK.

72
00:04:13,430 --> 00:04:20,910
One thousand and here as you can see in line 21 for the index number of one of these are life insurance

73
00:04:20,930 --> 00:04:22,240
is hourly here.

74
00:04:22,350 --> 00:04:24,610
I created an object of type boxing.

75
00:04:24,810 --> 00:04:25,440
OK.

76
00:04:25,440 --> 00:04:31,590
So again as you can see inside of this boxing class this boxing class actually inherits all of the features

77
00:04:31,620 --> 00:04:35,020
and behaviors that are inside of the sport class.

78
00:04:35,040 --> 00:04:35,470
OK.

79
00:04:35,550 --> 00:04:41,860
And this sports class actually implements this a life insurance interface.

80
00:04:41,940 --> 00:04:48,070
So there is actually an is a relationship between displacing and this life insurance interface.

81
00:04:48,180 --> 00:04:48,700
OK.

82
00:04:48,900 --> 00:04:51,620
So let's go back and say this main activity that of a fight here.

83
00:04:51,720 --> 00:04:57,750
He had actually created an object of type boxing and the constructor of boxing is actually being called

84
00:04:57,990 --> 00:05:05,250
Boxing fighting by using only hands boxing uniform and these are the values for this for the constructor

85
00:05:05,250 --> 00:05:06,290
of this boxing class.

86
00:05:06,330 --> 00:05:07,180
OK.

87
00:05:07,590 --> 00:05:13,490
And here for the index number two of these are life insurance as great as you can see here.

88
00:05:13,490 --> 00:05:15,940
I created an object of type kickboxing.

89
00:05:16,080 --> 00:05:21,660
So again because kickboxing actually inherits all of the features and behaviors that are inside of this

90
00:05:21,660 --> 00:05:28,100
boxing class and this boxing class inherits all of the features and behaviors that are inside of this

91
00:05:28,100 --> 00:05:34,290
sport class and this sport class actually implements this life insurance interface.

92
00:05:34,290 --> 00:05:38,010
So this kickboxing and this are life insurance as you can see here.

93
00:05:38,040 --> 00:05:44,560
There is and is our relationship between these kickboxing class and these life insurance interface.

94
00:05:44,580 --> 00:05:49,620
So inside of this main activity that our fight here as you can see I can actually create an object of

95
00:05:49,620 --> 00:05:55,320
type like sync as it can see and hear as you can see the construction of these kickboxing class is being

96
00:05:55,320 --> 00:05:59,810
called kickboxing fighting by punching and kicking kickboxing uniform.

97
00:05:59,820 --> 00:06:04,300
And these are the values for the constructed of these a kickboxing class as you can see here.

98
00:06:04,380 --> 00:06:04,790
OK.

99
00:06:04,890 --> 00:06:09,630
Now I'm going to actually paste in some lines of code here and then I'm going to explain to you what's

100
00:06:09,630 --> 00:06:10,230
going on here.

101
00:06:10,230 --> 00:06:11,300
OK.

102
00:06:11,580 --> 00:06:15,470
So as you can see here these are the lines of code that they actually paste that here.

103
00:06:15,690 --> 00:06:20,100
So first of all in line 29 I actually declared a string variable.

104
00:06:20,100 --> 00:06:24,880
Ok all the polymorphism and then I actually created a for loop.

105
00:06:24,900 --> 00:06:25,350
OK.

106
00:06:25,500 --> 00:06:28,230
So this is actually an enhanced for loop.

107
00:06:28,500 --> 00:06:34,630
And here I want to actually iterate over the values that are inside of this life insurance Aure.

108
00:06:34,840 --> 00:06:35,630
OK.

109
00:06:35,890 --> 00:06:40,790
So life insurance insurance object Colan life insurance says OK.

110
00:06:41,370 --> 00:06:48,230
And inside of this a for loop as you can see here I am instantiating this all the polymorphisms variable

111
00:06:48,350 --> 00:06:55,010
I just referred to the name of this valuable RTX the polymorphisms assignment operator here.

112
00:06:55,040 --> 00:06:59,180
I actually referred to the name of this object that is of type text view.

113
00:06:59,340 --> 00:07:04,330
So take the polymorphous at gettext that get text that are too strange.

114
00:07:04,350 --> 00:07:09,150
Here I am getting the text of this RTX the polymorphous that takes you and I am converting that value

115
00:07:09,150 --> 00:07:10,670
to our string body OK.

116
00:07:10,740 --> 00:07:17,410
And then I am assigning value to this all the polymorphism value but that I actually declared in line

117
00:07:17,650 --> 00:07:21,580
29 and in line 44 as you can see here.

118
00:07:21,690 --> 00:07:25,300
I just referred to the name of this object to the polymorphism.

119
00:07:25,380 --> 00:07:27,790
That said text string data format.

120
00:07:27,870 --> 00:07:32,240
OK all the polymorphism Plus this value OK.

121
00:07:32,340 --> 00:07:38,210
And here I am specifying the format the format of this string value Akkad person s.

122
00:07:38,310 --> 00:07:42,110
So this person s is actually for these insurance object.

123
00:07:42,120 --> 00:07:43,250
The twisting method.

124
00:07:43,410 --> 00:07:49,000
Ok this specific insurance object that is actually inside of this life insurance says Adli.

125
00:07:49,020 --> 00:07:49,490
OK.

126
00:07:49,500 --> 00:07:54,330
So for example for the first time that this is going to be executed.

127
00:07:54,670 --> 00:08:01,960
It's actually the insurance object is the object that is inside of the index zero of this life insurance

128
00:08:02,080 --> 00:08:02,690
rate.

129
00:08:03,030 --> 00:08:03,590
OK.

130
00:08:03,750 --> 00:08:08,290
For example this students and then it's going I should call the twisting Meffert of this.

131
00:08:08,460 --> 00:08:11,730
That is inside of this student class on this object.

132
00:08:11,790 --> 00:08:20,100
And then as you can see here this is there another argument for this format as you can see here we have

133
00:08:20,100 --> 00:08:24,740
person this person and this person is for this argument here.

134
00:08:24,840 --> 00:08:27,650
Life insurance costs colon space.

135
00:08:27,660 --> 00:08:29,080
We have a person here.

136
00:08:29,280 --> 00:08:33,940
So an insurance object that evaluates cost of insurance.

137
00:08:33,960 --> 00:08:40,020
So again you are calling to evaluate cost of insurance method that is specific to they actually object

138
00:08:40,020 --> 00:08:43,710
to the specific object that is inside of this insurance.

139
00:08:43,710 --> 00:08:45,210
Life insurance is free.

140
00:08:45,360 --> 00:08:46,300
OK.

141
00:08:46,440 --> 00:08:52,080
So for the first time that this group is going to be executed an object of type that is going to be

142
00:08:52,080 --> 00:08:53,250
is going to be created.

143
00:08:53,490 --> 00:08:57,830
And this evaluate cost of insurance if it is going to be called on this object.

144
00:08:57,870 --> 00:09:02,460
OK so now let's actually run our project and see what happens.

145
00:09:02,460 --> 00:09:08,610
So here as you can see our application actually crashed and let's go inside this lock here and let's

146
00:09:08,610 --> 00:09:09,920
see what's the error.

147
00:09:09,930 --> 00:09:10,800
OK.

148
00:09:10,800 --> 00:09:18,000
So as you can see here inside of the slug it says Dava that you steal that illegal format's conversion

149
00:09:18,000 --> 00:09:18,770
exception.

150
00:09:18,850 --> 00:09:22,950
Personality cannot format's dotted at length that double.

151
00:09:22,980 --> 00:09:23,520
OK.

152
00:09:23,610 --> 00:09:30,750
So as I said before for double arguments we need to actually use percent f but mistakenly here we use

153
00:09:30,990 --> 00:09:32,110
we use the person D.

154
00:09:32,280 --> 00:09:36,500
So change this person to person F and then run your project again.

155
00:09:36,510 --> 00:09:41,500
So as you can see here now our application is running on these our emulator here.

156
00:09:41,580 --> 00:09:45,550
As you can see it's not named John coarsening Android development.

157
00:09:45,740 --> 00:09:46,220
Life.

158
00:09:46,280 --> 00:09:54,290
Life insurance cost disvalue name boxing rules fighting by using only Hanse uniform boxing uniform Spizz

159
00:09:54,350 --> 00:09:56,750
requires 1000 power required.

160
00:09:56,770 --> 00:09:57,650
Eight hundred.

161
00:09:57,840 --> 00:10:02,750
Punching power required 2000 are punching speed requires 5000.

162
00:10:02,840 --> 00:10:05,240
Life insurance costs are 6000.

163
00:10:05,480 --> 00:10:10,450
And here you can see name kickboxing ludes fighting by punching and kicking.

164
00:10:10,700 --> 00:10:15,970
Uniform kickboxing uniform speeds required 2000 power required.

165
00:10:16,070 --> 00:10:25,400
If I wasn't a punching power required 4000 punching spit required 7000 Keech power required free thousand

166
00:10:25,800 --> 00:10:26,320
and.

167
00:10:26,380 --> 00:10:31,870
It requires 5000 and he had as you can see it says life insurance costs 2000.

168
00:10:31,900 --> 00:10:39,500
OK so as you know inside of this kickboxing class I didn't overwrite this evaluate cost of insurance

169
00:10:39,510 --> 00:10:45,730
Smurfit OK because I actually diskless actually inherits all of the features and behaviors that are

170
00:10:45,720 --> 00:10:47,450
in sight of this boxing class.

171
00:10:48,130 --> 00:10:52,570
And this boxing class actually provided an implementation for that method.

172
00:10:52,630 --> 00:10:56,090
Ok this kickboxing class actually inherits that behavior.

173
00:10:56,090 --> 00:11:02,390
Keep in head is that implementation and as you can see here it says life insurance costs are 2000.

174
00:11:02,510 --> 00:11:04,170
OK as you can see here.

175
00:11:04,620 --> 00:11:11,330
So hopefully that makes sense and if you have any questions please post the discussion in the course

176
00:11:11,750 --> 00:11:14,380
and I'll do my best to answer all of your questions.

177
00:11:14,850 --> 00:11:19,250
And thank you very much for watching and I'll see you in the next section.

