1
00:00:00,300 --> 00:00:01,880
The superclass is the Object class.

2
00:00:01,890 --> 00:00:02,750
OK.

3
00:00:03,210 --> 00:00:08,500
And inside the Meffert as you can see here it says Return So pair that to a stranger.

4
00:00:08,580 --> 00:00:15,900
It means that it can actually implement the codes that are inside the two string Mefford inside the

5
00:00:15,900 --> 00:00:16,680
Object class.

6
00:00:16,680 --> 00:00:17,120
OK.

7
00:00:17,160 --> 00:00:19,140
It's going to implement this line of code here.

8
00:00:19,470 --> 00:00:20,640
OK.

9
00:00:20,640 --> 00:00:27,270
So we don't want this line of code to be executed in our chat class so I don't want these super strange

10
00:00:28,140 --> 00:00:30,790
code to be executed so I just delete it here.

11
00:00:30,810 --> 00:00:31,210
OK.

12
00:00:31,230 --> 00:00:32,840
So our superclass is object.

13
00:00:32,850 --> 00:00:33,280
OK.

14
00:00:33,330 --> 00:00:34,520
Object here.

15
00:00:34,890 --> 00:00:35,510
OK.

16
00:00:35,700 --> 00:00:37,520
And when it says Return a super.

17
00:00:37,530 --> 00:00:43,660
That was three and it means that this class implements this code that is inside these two string method.

18
00:00:43,680 --> 00:00:44,680
OK.

19
00:00:44,700 --> 00:00:49,800
So let's go back inside the chatter Java class here and now I want to actually put my implementations

20
00:00:50,070 --> 00:00:50,920
inside this method.

21
00:00:50,930 --> 00:00:55,570
OK I want to actually put my own code inside this method OK.

22
00:00:55,590 --> 00:00:59,130
That is actually specifically related to these cathe class.

23
00:00:59,220 --> 00:01:00,070
OK.

24
00:01:00,390 --> 00:01:08,880
So inside this Meffert I just need to type in here return as three dot format and then inside Apprentice's

25
00:01:08,970 --> 00:01:13,200
I need to actually specify the format of this string value.

26
00:01:13,200 --> 00:01:16,930
So as you can see here the Smurfette returns a value of type string.

27
00:01:16,960 --> 00:01:19,990
Ok the return type of this method is strange.

28
00:01:20,010 --> 00:01:23,060
So we need to actually return a value of string here.

29
00:01:23,160 --> 00:01:25,320
Returns 3 in that format.

30
00:01:25,560 --> 00:01:29,740
And first of all I want to actually specify the formatting instructions.

31
00:01:29,940 --> 00:01:39,300
So I just put into double quotes and then inside the double quotes I just type in percent as Colon space

32
00:01:39,450 --> 00:02:03,020
per cent as space percent as Colon percent as space persons as Colon space per cent the space present

33
00:02:03,200 --> 00:02:13,950
as Colon space percent the space per cent as space per cent.

34
00:02:15,000 --> 00:02:21,990
And then I actually put a comma here and now I want to actually specify the arguments that are going

35
00:02:21,990 --> 00:02:23,940
to be related to these tokens here.

36
00:02:23,940 --> 00:02:24,420
OK.

37
00:02:24,480 --> 00:02:30,120
So for example for this token here I need to actually specify an argument of type 3.

38
00:02:30,270 --> 00:02:30,750
OK.

39
00:02:30,810 --> 00:02:35,020
Because this talking is per cent as is stands for strange.

40
00:02:35,050 --> 00:02:38,300
OK so s is for string values.

41
00:02:38,480 --> 00:02:40,240
Ok so I just need to type in here.

42
00:02:40,290 --> 00:02:47,600
So I just need to put in two double quotes here name as you can see I put a string literal here.

43
00:02:47,820 --> 00:02:50,480
This name is for this a token here.

44
00:02:50,850 --> 00:02:53,080
And our second talken is present as.

45
00:02:53,100 --> 00:02:57,430
So we need to actually specify an argument of type strange name.

46
00:02:57,510 --> 00:03:05,270
I refer to the name of the name instance variable which is of type string here comma and that our first

47
00:03:05,300 --> 00:03:08,100
Torchin it again is present as.

48
00:03:08,190 --> 00:03:13,160
So I just need to put in into double quotes here and that inside the double quotes I just type in color

49
00:03:14,270 --> 00:03:16,420
and then I put a comma here.

50
00:03:17,040 --> 00:03:21,420
And as you can see here again are form of talken is percent.

51
00:03:21,450 --> 00:03:25,020
So when you actually put a value of type three in here.

52
00:03:25,020 --> 00:03:29,180
So I just refer to the name of the color instance variable comma.

53
00:03:29,460 --> 00:03:34,390
Again our fifth fortune is present as as you can see here.

54
00:03:34,410 --> 00:03:37,490
So we need to actually specify an argument of type strength.

55
00:03:37,680 --> 00:03:40,990
So I just need to put in two double quotes here instead of double quotes.

56
00:03:41,010 --> 00:03:49,070
I just type again just typing speed and then I put a comma here and then as you can see here percent

57
00:03:49,120 --> 00:03:49,580
D.

58
00:03:49,680 --> 00:03:53,180
So we need to actually put an argument of type integer.

59
00:03:53,190 --> 00:03:58,860
So I just need to refer to the name of the amount of speed instance variable and then I put a comma

60
00:03:58,860 --> 00:03:59,450
here.

61
00:03:59,790 --> 00:04:07,380
And again here I need to actually specify an argument of types 3 in here because this token here is

62
00:04:07,380 --> 00:04:08,310
percent.

63
00:04:08,530 --> 00:04:09,270
OK.

64
00:04:09,540 --> 00:04:18,330
So I just need to put into double quotes power and then I put a comma here and again as you can see

65
00:04:19,230 --> 00:04:21,850
distortion here is percent D.

66
00:04:21,900 --> 00:04:26,550
So we need to actually put an argument of type integer here.

67
00:04:26,550 --> 00:04:32,470
So we just need to refer to the name of the amount of the name of the amount of power the instance variable.

68
00:04:32,850 --> 00:04:34,670
And then I put a comma here.

69
00:04:35,010 --> 00:04:38,780
And as you can see here again we have a present as here.

70
00:04:38,880 --> 00:04:45,630
So we need to actually put a value of type 3 in here so I can just refer here so I can just put in two

71
00:04:45,630 --> 00:04:47,320
double quotes here and there.

72
00:04:47,340 --> 00:04:52,440
Inside the double quotes I can just type in number of legs and then I put a comma here.

73
00:04:52,680 --> 00:04:56,690
And as you can see here we have these percent D here.

74
00:04:56,700 --> 00:05:00,140
So we need to actually put up an argument of type integer.

75
00:05:00,240 --> 00:05:05,340
So I can just refer to the name of the name of the number of legs instance variable.

76
00:05:06,000 --> 00:05:10,180
And we have another instance variable here which is of type Boolean.

77
00:05:10,200 --> 00:05:10,770
OK.

78
00:05:10,980 --> 00:05:16,710
So in order to specify that we are going to actually put up a boolean value here.

79
00:05:17,040 --> 00:05:19,030
We need to actually put a token here.

80
00:05:19,040 --> 00:05:23,350
OK for the boolean value Bellis so we can just put in percent B.

81
00:05:23,640 --> 00:05:26,370
So this percent B is for boolean variables.

82
00:05:26,400 --> 00:05:34,520
OK so here I can't just put a comma here and then I can just refer to the name of my instance variable.

83
00:05:34,740 --> 00:05:37,110
Chan hont other animals.

84
00:05:37,120 --> 00:05:37,770
OK.

85
00:05:38,130 --> 00:05:40,590
And then I put a semicolon here.

86
00:05:40,590 --> 00:05:47,810
So in order to specify what these I can hunt other animals instance variable relates to again just putting

87
00:05:48,120 --> 00:05:53,800
another string value here before this instance variable.

88
00:05:54,210 --> 00:06:04,050
So I can't just putting in a percent here and then I can just put in two double quotes here and here.

89
00:06:04,050 --> 00:06:04,800
Inside.

90
00:06:04,950 --> 00:06:10,700
Inside these double quotes I can just putting in for example fight.

91
00:06:11,730 --> 00:06:12,590
OK.

92
00:06:12,990 --> 00:06:14,810
And then I put a comma here.

93
00:06:15,210 --> 00:06:19,480
So now let's actually go back inside the main activity that Java right here.

94
00:06:19,500 --> 00:06:24,780
Now as you can see inline 42 I called this method on this Kathe one object here.

95
00:06:24,780 --> 00:06:25,370
OK.

96
00:06:25,380 --> 00:06:31,350
So because we write that these are two strings Meffert here is going to actually call only the Smurfette

97
00:06:31,350 --> 00:06:31,660
here.

98
00:06:31,680 --> 00:06:32,460
OK.

99
00:06:32,670 --> 00:06:34,380
So if I had on my project.

100
00:06:34,380 --> 00:06:36,240
Now let's see what happens.

101
00:06:36,240 --> 00:06:39,800
So as you can see here this is the value that is output at here.

102
00:06:39,810 --> 00:06:48,820
OK name my chat color white speed 40 power 50 number of legs for fight true.

103
00:06:49,260 --> 00:06:49,790
OK.

104
00:06:49,800 --> 00:06:52,110
So hopefully that makes sense.

105
00:06:52,140 --> 00:06:56,540
Now I want to actually show you again the power of inheritance in Java.

106
00:06:56,910 --> 00:07:03,450
Let's go back inside the cat the job fight here and now as you can see we've got a lot of duplicated

107
00:07:03,450 --> 00:07:07,450
codes that are inside the animal class here.

108
00:07:07,470 --> 00:07:08,160
OK.

109
00:07:08,400 --> 00:07:13,230
So as you can see in reality these two classes can be related to each other.

110
00:07:13,260 --> 00:07:17,050
This math class and this animal class can be related to each other.

111
00:07:17,160 --> 00:07:18,340
OK.

112
00:07:18,480 --> 00:07:21,640
And a cat can be an animal.

113
00:07:21,900 --> 00:07:29,760
So our cat is an animal so we can actually inherit from the Animal class.

114
00:07:29,760 --> 00:07:33,550
OK so Chad extends animal.

115
00:07:34,590 --> 00:07:35,510
OK.

116
00:07:36,090 --> 00:07:40,550
So as you can see here now it's going to actually show us some errors here.

117
00:07:40,920 --> 00:07:41,600
OK.

118
00:07:41,700 --> 00:07:49,290
So because if you are inheriting all of the features and behaviors that are inside the Animal class

119
00:07:49,870 --> 00:07:56,240
we can actually delete some of those duplicated coats for example DS for instance variables name color

120
00:07:56,310 --> 00:07:58,640
amount of speed and amount of power.

121
00:07:58,770 --> 00:08:05,700
We don't need these instance variables here because we are inheriting all of the behaviors and characteristics

122
00:08:05,910 --> 00:08:10,760
inside this Animal class as you can see because these are instance variables here.

123
00:08:10,860 --> 00:08:15,650
So we don't need these are instance variables inside the Kathe class.

124
00:08:15,660 --> 00:08:20,660
So if I just want to delete this instance variables here.

125
00:08:21,040 --> 00:08:26,240
Now I've got two instance variables that are related only to this math class.

126
00:08:26,250 --> 00:08:26,730
OK.

127
00:08:26,850 --> 00:08:29,490
Number of legs can hunt other animals.

128
00:08:29,490 --> 00:08:30,120
OK.

129
00:08:30,210 --> 00:08:35,270
So as you can see here let's actually delete some of these codes here.

130
00:08:35,280 --> 00:08:41,310
These getters and setters which we don't need them as you can see get get em out of power set amount

131
00:08:41,310 --> 00:08:45,580
of power get em out of speed set amount of speed get color get training.

132
00:08:45,750 --> 00:08:46,550
OK.

133
00:08:46,980 --> 00:08:50,520
And as you can see here we've got only these MFX here.

134
00:08:50,640 --> 00:08:57,760
Get our Chan hunt other animals so they can hunt other animals which is for this instance valuable here.

135
00:08:57,960 --> 00:09:03,230
And we've got a get in my faith for this number of legs instance variable here.

136
00:09:03,240 --> 00:09:03,760
OK.

137
00:09:03,870 --> 00:09:10,200
And as you can see here we can actually delete these lines of code here again and we can actually delete

138
00:09:10,440 --> 00:09:13,320
these arguments here.

139
00:09:13,650 --> 00:09:21,470
As you can see three color as you can see here in that amount of speed.

140
00:09:22,110 --> 00:09:24,200
OK we don't need this here.

141
00:09:24,630 --> 00:09:32,710
And we only need this number of legs soluble and these are Chan hont other animals valuable OK.

142
00:09:32,730 --> 00:09:38,490
And now here again we can actually change the implementation's that is inside these two string Mefford.

143
00:09:38,490 --> 00:09:43,260
So analogus actually did it this line of code here and then I'll actually show you how we can actually

144
00:09:43,260 --> 00:09:46,160
put our own code again in inside this Meffert here.

145
00:09:46,170 --> 00:09:46,570
OK.

146
00:09:46,620 --> 00:09:47,660
OK everyone.

147
00:09:47,660 --> 00:09:50,310
Now that's enough for this theater.

148
00:09:50,520 --> 00:09:57,030
And in the next tutorial we're going to actually continue building our fourth Android application.

149
00:09:57,210 --> 00:09:57,960
OK.

150
00:09:57,960 --> 00:09:59,180
So thanks for watching.

151
00:09:59,220 --> 00:10:04,560
And if you have any questions please post the discussion in the course and then I'll do my best to answer

152
00:10:04,560 --> 00:10:05,510
your questions.

153
00:10:05,700 --> 00:10:09,610
Thank you for watching and I'll see you in the next tutorial.

