1
00:00:00,480 --> 00:00:06,900
So because we declare this sport class as you can see here as an abstract class OK.

2
00:00:07,050 --> 00:00:10,740
Now you can see that the compiler doesn't show us any error.

3
00:00:10,740 --> 00:00:13,490
So now I want to actually implement the error is gone.

4
00:00:13,530 --> 00:00:14,150
OK.

5
00:00:14,160 --> 00:00:19,950
And this class this sport class actually implements this life insurance interface.

6
00:00:20,010 --> 00:00:20,470
OK.

7
00:00:20,580 --> 00:00:27,960
So here let's actually create some getters and setters for our instance variables here.

8
00:00:28,020 --> 00:00:28,370
OK.

9
00:00:28,390 --> 00:00:31,700
So so instead of this class just basically here.

10
00:00:31,800 --> 00:00:32,450
OK.

11
00:00:32,760 --> 00:00:38,520
And then actually can generate and then we can get here and setter and the list actually select all

12
00:00:38,520 --> 00:00:38,950
of these.

13
00:00:38,950 --> 00:00:41,840
Instance variables and then click on OK.

14
00:00:42,270 --> 00:00:44,910
So now as you can see the ITD Android.

15
00:00:44,950 --> 00:00:47,470
So you are the ID actually it.

16
00:00:47,490 --> 00:00:50,830
These are good heroes and sitters are automatically for us.

17
00:00:50,840 --> 00:00:59,700
Kate gets Name City Name get rules set rules get uniform set uniform OK good speed required set speed

18
00:00:59,700 --> 00:01:03,790
requires gets power required and set the power required.

19
00:01:03,840 --> 00:01:07,280
OK so now I want to actually are.

20
00:01:07,350 --> 00:01:14,370
All right the twist thing is that these are sport class actually implicitly inherits from the Object

21
00:01:14,370 --> 00:01:14,640
class.

22
00:01:14,640 --> 00:01:20,280
Ok so here you can see I can just put in extends object.

23
00:01:20,280 --> 00:01:27,000
Here I am actually explicitly inheriting all of the features and behaviors that are inside of the Object

24
00:01:27,000 --> 00:01:33,060
class and this class also implements this life insurance interface as you can see here.

25
00:01:33,060 --> 00:01:39,230
OK so now let's actually overwrite the two string Meffert that is inside of the Object class.

26
00:01:39,390 --> 00:01:41,380
Ok so I can just put it here.

27
00:01:41,730 --> 00:01:45,360
So here as you can see I pasted these lines of code here at St..

28
00:01:45,420 --> 00:01:46,800
Right public.

29
00:01:46,950 --> 00:01:48,390
Strange too strange.

30
00:01:48,420 --> 00:01:49,360
OK.

31
00:01:49,380 --> 00:01:52,410
And this move is actually as good as you can't see returns a string value.

32
00:01:52,560 --> 00:01:57,730
So here inside of the sniffer as you can see I'm saying that return string data format.

33
00:01:58,140 --> 00:02:00,510
And he had set up these double codes.

34
00:02:00,510 --> 00:02:04,580
I am actually specifying the format of my string value.

35
00:02:04,620 --> 00:02:05,120
OK.

36
00:02:05,160 --> 00:02:06,030
Per Cent.

37
00:02:06,150 --> 00:02:10,670
So here this token person this is actually referring to this name here.

38
00:02:10,680 --> 00:02:19,130
OK this string value call in person s gets name or key person in a newline character and other person.

39
00:02:19,200 --> 00:02:26,660
So these rules here as you can see is for just a token as you can see here call it space person as sort

40
00:02:26,670 --> 00:02:33,690
this person as is for this gets rules OK and a person in a newline character and person s as you can

41
00:02:33,690 --> 00:02:35,720
see here is for this uniform.

42
00:02:36,030 --> 00:02:36,520
OK.

43
00:02:36,620 --> 00:02:37,970
Kallen space.

44
00:02:38,130 --> 00:02:40,540
We have another person as here gets uniform.

45
00:02:40,660 --> 00:02:44,970
OK a person as a person in as you can see here.

46
00:02:45,120 --> 00:02:46,260
This is a new character.

47
00:02:46,270 --> 00:02:48,190
We have another person is here.

48
00:02:48,240 --> 00:02:51,590
So this person is Fortius spit required here.

49
00:02:51,930 --> 00:02:54,320
Co-lead Space Person D.

50
00:02:54,450 --> 00:02:57,900
Ok so this person is for this gets speed required.

51
00:02:58,030 --> 00:03:04,750
Ok person has a new line character person s and this person is for this power requires.

52
00:03:04,770 --> 00:03:07,700
And as you can see here Colan space person.

53
00:03:07,830 --> 00:03:10,460
So this person is what this gets power required.

54
00:03:10,500 --> 00:03:11,400
OK.

55
00:03:11,610 --> 00:03:13,580
So hopefully death makes sense.

56
00:03:13,620 --> 00:03:16,380
And now let's actually go inside of this box in class.

57
00:03:16,410 --> 00:03:16,860
OK.

58
00:03:16,980 --> 00:03:18,500
Now I want to actually.

59
00:03:18,570 --> 00:03:21,530
So as you know boxing is actually a sport.

60
00:03:21,540 --> 00:03:22,130
OK.

61
00:03:22,140 --> 00:03:28,250
So there is actually an is a relationship between the boxing class and this sport class.

62
00:03:28,260 --> 00:03:30,860
So here again to say it extends sport.

63
00:03:30,900 --> 00:03:33,860
So now as you can see the compiler is actually complaining.

64
00:03:34,140 --> 00:03:39,180
And let's actually hover on a mouse pointer over the area and see what's the error.

65
00:03:39,210 --> 00:03:46,510
Plus boxing must either be declared abstract OK or implement abstract method.

66
00:03:46,570 --> 00:03:48,550
Evaluate cost of insurance.

67
00:03:48,750 --> 00:03:57,240
So as you know boxing is not an abstract concept so we need to actually implement the cost of insurance

68
00:03:57,540 --> 00:04:02,060
a method that is actually declared inside of these life insurance interface.

69
00:04:02,160 --> 00:04:07,150
So because we are actually inheriting all of the features and behaviors that it inside of this support

70
00:04:07,150 --> 00:04:14,250
class and this support class actually implements this life insurance interface here inside of this boxing

71
00:04:14,250 --> 00:04:20,760
class we need to actually overwrite the abstract method that is inside of this life insurance interface

72
00:04:20,790 --> 00:04:21,730
as you can see here.

73
00:04:21,810 --> 00:04:22,160
OK.

74
00:04:22,170 --> 00:04:27,240
So hopefully that makes sense now necessarily actually putting some more lines of code here.

75
00:04:27,330 --> 00:04:27,780
OK.

76
00:04:27,780 --> 00:04:32,770
Now inside of this box in class that's actually declare some instance variables.

77
00:04:32,820 --> 00:04:33,580
OK.

78
00:04:33,930 --> 00:04:37,270
So here as you can see I declare these these instance variables.

79
00:04:37,290 --> 00:04:37,700
OK.

80
00:04:37,710 --> 00:04:42,030
Int punching power required int punching speed required.

81
00:04:42,120 --> 00:04:44,430
And ain't a cost of insurance.

82
00:04:44,460 --> 00:04:48,320
So let's actually declare these instance variables as private.

83
00:04:48,660 --> 00:04:49,160
OK.

84
00:04:49,200 --> 00:04:54,990
Private and hear private and private.

85
00:04:55,500 --> 00:04:56,080
OK.

86
00:04:56,400 --> 00:05:00,730
So now they essentially create a constructor for these in class.

87
00:05:00,770 --> 00:05:05,770
So inside of this box in class I'm going to actually pasting this constructor here and then I'm going

88
00:05:05,770 --> 00:05:08,500
to explain to you what's going on here.

89
00:05:08,530 --> 00:05:12,710
So as you can see here we have a constructor here Puplick public boxing.

90
00:05:12,910 --> 00:05:19,900
And here as you can see this box image actually does boxing constructor actually accepts some arguments.

91
00:05:19,900 --> 00:05:20,300
OK.

92
00:05:20,390 --> 00:05:27,810
String name string rules string uniform and speed required into power required.

93
00:05:27,940 --> 00:05:29,110
And as you can see here.

94
00:05:29,170 --> 00:05:33,910
Punching power required and punching sweetly quiet.

95
00:05:34,030 --> 00:05:38,090
And it cost of insurance and inside that is constructive.

96
00:05:38,290 --> 00:05:44,030
Because I am actually inheriting all of the features and behaviors that are inside of this sports class.

97
00:05:44,170 --> 00:05:47,520
We need to initialize the constructor of the superclass.

98
00:05:47,620 --> 00:05:51,360
So super name rules uniform.

99
00:05:51,870 --> 00:05:54,120
Spaeth required and power required.

100
00:05:54,160 --> 00:05:54,640
OK.

101
00:05:54,880 --> 00:05:58,930
And then we can actually instantiate our own instance variables.

102
00:05:58,930 --> 00:05:59,510
OK.

103
00:05:59,800 --> 00:06:05,650
This does punching power required assignments operator punching power required.

104
00:06:05,680 --> 00:06:06,160
OK.

105
00:06:06,430 --> 00:06:12,730
Does that punching Spitze required as you can see here I am referring to this instance variable assignment

106
00:06:12,760 --> 00:06:15,120
operator punching required.

107
00:06:15,160 --> 00:06:15,610
OK.

108
00:06:15,670 --> 00:06:19,430
And does that cost that insurance assignment operator.

109
00:06:19,540 --> 00:06:21,010
Cost of insurance.

110
00:06:21,040 --> 00:06:21,790
OK.

111
00:06:22,000 --> 00:06:23,450
So hopefully that makes sense.

112
00:06:23,470 --> 00:06:28,750
Now let's actually create a Getaround the Center for these two instance variables are key punching power

113
00:06:28,750 --> 00:06:30,800
required and punching speeds required.

114
00:06:30,820 --> 00:06:31,710
OK.

115
00:06:31,750 --> 00:06:36,880
We don't need to actually create or get her the city for this cluster insurance instance variable.

116
00:06:36,960 --> 00:06:37,580
OK.

117
00:06:37,780 --> 00:06:44,410
So here again just slightly and say that this class generate and get here and sit here and here for

118
00:06:44,410 --> 00:06:50,920
these two instance variables punching power required and this instance valuable punching Kuspit require

119
00:06:51,070 --> 00:06:54,980
you selectees instance variables and then click on OK.

120
00:06:55,060 --> 00:07:01,530
So as you can see the ID actually automatically generated these instance variables for us.

121
00:07:01,600 --> 00:07:04,040
These are these getters and setters for us.

122
00:07:04,080 --> 00:07:04,680
Okay.

123
00:07:05,140 --> 00:07:12,310
And now let's actually overwrite the Evaluate cost of insurance Smurfit that is inside of this life

124
00:07:12,310 --> 00:07:14,250
insurance interface.

125
00:07:14,440 --> 00:07:20,610
So here because of your inheriting all of the features and behaviors that are inside of this sport class.

126
00:07:20,610 --> 00:07:20,860
Okay.

127
00:07:20,860 --> 00:07:27,100
So let's to go inside of this sort of last year and this sports class actually implements life insurance

128
00:07:27,190 --> 00:07:34,870
interface this boxing class must actually provide an implementation for these for there are costs of

129
00:07:34,870 --> 00:07:39,000
insurance Smurfette that is in say that this life insurance interface.

130
00:07:39,080 --> 00:07:46,120
So inside of this boxing class I as I say pain evaluates a cost of insurance Mefford as you can see

131
00:07:46,120 --> 00:07:53,810
here and here we are actually operating disparate public double evaluate cost of insurance.

132
00:07:53,810 --> 00:07:59,950
So let's actually delete this implementation here and now we can i should be putting our own implementations

133
00:08:00,250 --> 00:08:01,970
inside of this method.

134
00:08:01,990 --> 00:08:02,440
OK.

135
00:08:02,500 --> 00:08:04,680
So here I can just type in return.

136
00:08:04,690 --> 00:08:05,770
Cost of insurance.

137
00:08:05,800 --> 00:08:06,570
Semicolon.

138
00:08:06,850 --> 00:08:07,510
OK.

139
00:08:07,510 --> 00:08:13,620
So inside of this Meffert I'm just returning the value of this a custom insurance instance variable

140
00:08:13,640 --> 00:08:17,260
that I like that I actually created inside of this box in class.

141
00:08:17,380 --> 00:08:17,750
OK.

142
00:08:17,800 --> 00:08:23,710
And here after the Smurfit after the Indian curly brace up this my fit and inside of this boxing class

143
00:08:24,030 --> 00:08:29,790
let's actually override the twisting method that we actually inherited from the superclass.

144
00:08:29,800 --> 00:08:33,110
So what is the superclass the superclass is the sport class.

145
00:08:33,160 --> 00:08:33,600
OK.

146
00:08:33,700 --> 00:08:36,190
And we can actually inherit this method.

147
00:08:36,310 --> 00:08:36,830
OK.

148
00:08:36,940 --> 00:08:41,490
So inside of this boxing class here again just typing to a stranger.

149
00:08:42,070 --> 00:08:45,400
And let's actually delete this line of code here.

150
00:08:45,670 --> 00:08:47,890
And let's actually put in our own implementations.

151
00:08:47,920 --> 00:08:51,170
That is actually specific only to the boxing class here.

152
00:08:51,280 --> 00:08:56,800
OK so now I'm going to actually pasting some lines of code here and then I'm going to actually explain

153
00:08:56,800 --> 00:08:58,520
to you what's going on here.

154
00:08:58,540 --> 00:08:59,560
OK.

155
00:08:59,560 --> 00:09:04,740
So as you can see here this is the implementation that we actually put in here.

156
00:09:04,810 --> 00:09:09,290
OK return string format here and inside double quotes.

157
00:09:09,340 --> 00:09:13,740
I am actually specifying the format of my string value so person s.

158
00:09:13,840 --> 00:09:18,780
So this person as here had this token is actually for this super string here.

159
00:09:18,820 --> 00:09:19,300
OK.

160
00:09:19,300 --> 00:09:20,680
So super eject.

161
00:09:20,840 --> 00:09:23,030
I should be the first to the superclass.

162
00:09:23,140 --> 00:09:26,040
So the superclass is actually this sport class.

163
00:09:26,110 --> 00:09:26,560
OK.

164
00:09:26,680 --> 00:09:29,700
And inside of this sport class we have these two strings left.

165
00:09:29,710 --> 00:09:30,300
OK.

166
00:09:30,560 --> 00:09:36,290
So if this boxing class as you can see he actually called these are two string Meffert on this super.

167
00:09:36,340 --> 00:09:36,910
OK.

168
00:09:36,910 --> 00:09:42,580
So here as you can see we are actually going to actually execute these lines of code that are actually

169
00:09:42,580 --> 00:09:45,870
inside of these two string Mefford here as you can see.

170
00:09:46,330 --> 00:09:50,370
And then here it's going to return these values.

171
00:09:50,380 --> 00:09:56,730
Ok for example gets name cathedral's gets you any form gets speed required and gets our power required.

172
00:09:56,770 --> 00:09:57,180
OK.

