1
00:00:00,480 --> 00:00:06,930
Hi everyone it is literally all we're going to go ahead and continue building our fourth Android application.

2
00:00:06,990 --> 00:00:09,720
Let's go actually inside this Leppert class.

3
00:00:09,750 --> 00:00:11,730
And as you can see this is our first class.

4
00:00:11,730 --> 00:00:12,360
OK.

5
00:00:12,630 --> 00:00:18,690
So first as you know Leppert is inside the chad family animals.

6
00:00:18,750 --> 00:00:19,380
OK.

7
00:00:19,440 --> 00:00:26,660
So we can actually extend from the cat class here extends.

8
00:00:27,420 --> 00:00:33,650
OK and we can actually inherit all of the features and behaviors that are inside this math class.

9
00:00:33,660 --> 00:00:34,360
OK.

10
00:00:34,920 --> 00:00:42,010
So as you can see here first let's actually create a characteristic that is only specific to this first

11
00:00:42,060 --> 00:00:42,420
class.

12
00:00:42,450 --> 00:00:46,100
Ok for example a leopard has sharp claws.

13
00:00:46,110 --> 00:00:46,620
OK.

14
00:00:46,680 --> 00:00:56,850
So you can't just create a private strength and the name of my instance variable is class assignment

15
00:00:56,880 --> 00:00:57,760
operator.

16
00:00:57,870 --> 00:01:03,560
And then I put into double quotes here and then instead of double quotes I can just type in shot.

17
00:01:04,280 --> 00:01:10,620
OK so now let's actually create a constructor OK for this leper's class.

18
00:01:10,620 --> 00:01:13,310
So first of all I need to type in public.

19
00:01:13,860 --> 00:01:19,010
And then the name of my constructor must be the same as the name of this class.

20
00:01:19,380 --> 00:01:23,340
And then I actually open and close this constructor by using these curly braces.

21
00:01:23,350 --> 00:01:29,490
OK so first of all I need to actually initialize the constructor of the superclass because this leper's

22
00:01:29,490 --> 00:01:35,010
class is is actually inheriting all of the features and behaviors that are inside this chat class into

23
00:01:35,010 --> 00:01:40,080
These are Lepus class we need to actually initialize the constructor that is inside.

24
00:01:40,080 --> 00:01:41,580
These are trans class here.

25
00:01:41,580 --> 00:01:41,970
OK.

26
00:01:42,030 --> 00:01:47,490
As you can see we've got a custom constructor in this class so we need to actually initialize this constructor

27
00:01:47,490 --> 00:01:47,930
here.

28
00:01:48,060 --> 00:01:48,760
OK.

29
00:01:48,960 --> 00:01:56,000
So I can just take it super And then inside the prentices I need to actually pass some arguments here.

30
00:01:56,010 --> 00:02:01,200
OK let's actually specify these arguments here for this Leppert constructor.

31
00:02:01,530 --> 00:02:06,920
So the first argument should be of types 3 and name.

32
00:02:07,220 --> 00:02:08,040
OK.

33
00:02:08,410 --> 00:02:14,120
Again the second argument should be of types 3 inch color comma.

34
00:02:14,280 --> 00:02:14,880
OK.

35
00:02:15,120 --> 00:02:19,190
So let's actually go inside this class and see are there arguments.

36
00:02:19,190 --> 00:02:19,600
OK.

37
00:02:19,710 --> 00:02:22,840
Name calling and I'm out of speed.

38
00:02:23,100 --> 00:02:23,770
OK.

39
00:02:24,100 --> 00:02:34,840
So int amount of speed comma end amount of power.

40
00:02:36,090 --> 00:02:37,590
OK come on.

41
00:02:38,130 --> 00:02:40,120
Let's the other arguments.

42
00:02:40,200 --> 00:02:42,910
A number of lakes and can hunt other animals.

43
00:02:42,930 --> 00:02:43,430
OK.

44
00:02:43,650 --> 00:02:45,810
And number of legs

45
00:02:49,420 --> 00:02:54,550
comma and Boullion Chan hunt other animals.

46
00:02:54,570 --> 00:02:55,210
OK.

47
00:02:55,350 --> 00:02:55,590
OK.

48
00:02:55,590 --> 00:03:01,910
So let's actually create new line here and inside Apprentice's here for the super.

49
00:03:02,100 --> 00:03:03,750
I can just passing these values.

50
00:03:03,800 --> 00:03:10,990
Name comma color comma amount of speed comma.

51
00:03:11,010 --> 00:03:12,300
Amount of power.

52
00:03:12,490 --> 00:03:13,000
OK.

53
00:03:13,180 --> 00:03:19,280
Comma number of Lex comma Trahant other elements.

54
00:03:19,500 --> 00:03:24,700
So as you can see here if you have successfully initialized the constructor of the superclass.

55
00:03:24,770 --> 00:03:27,900
OK so now we can actually initialize.

56
00:03:27,900 --> 00:03:35,060
So now we can actually initialize this class instance variable.

57
00:03:35,150 --> 00:03:42,660
Can actually give values to our instance variables or we can actually just don't give a value to this

58
00:03:42,660 --> 00:03:43,660
instance variable.

59
00:03:43,860 --> 00:03:49,200
And when we actually create an object from the Slipper's class which has passed a value for these class

60
00:03:49,200 --> 00:03:50,650
instance variable OK.

61
00:03:50,880 --> 00:03:53,560
So for this class instance variable.

62
00:03:53,730 --> 00:03:56,270
Let's actually create an argument here.

63
00:03:56,340 --> 00:03:59,310
So strange class.

64
00:03:59,540 --> 00:04:00,230
OK.

65
00:04:00,690 --> 00:04:08,010
And now I can actually initialize this instance variable here so I can just refer to this to this instance

66
00:04:08,010 --> 00:04:09,800
variable by just typing this.

67
00:04:09,830 --> 00:04:14,050
That class assignment operator class.

68
00:04:14,190 --> 00:04:21,240
So hopefully that makes sense and then I can actually create a set here and they get in my bed for this

69
00:04:21,510 --> 00:04:23,250
class instance variable.

70
00:04:23,250 --> 00:04:30,180
So let's actually right click on these chat class outside of this constructor here and then click on

71
00:04:30,180 --> 00:04:36,690
generate and and click on get her and set her and then choose this class instance variable and then

72
00:04:36,690 --> 00:04:37,660
click on OK.

73
00:04:37,830 --> 00:04:42,030
This is a get here for this class instance variable.

74
00:04:42,720 --> 00:04:45,470
And this is all set up for this class instance variable.

75
00:04:45,480 --> 00:04:52,530
Ok so now let's actually override the two history if it that we actually inherit from the math class

76
00:04:52,860 --> 00:04:59,880
and the class inherit the twittering Meffert from the Animal class and the Animal class inherits these

77
00:04:59,880 --> 00:05:02,120
to a string Meffert from the Object class.

78
00:05:02,130 --> 00:05:02,740
OK.

79
00:05:03,090 --> 00:05:10,410
So this Leppert class in indirectly inherits all of the behaviors and features that are inside this

80
00:05:10,560 --> 00:05:11,210
object class.

81
00:05:11,220 --> 00:05:12,140
OK.

82
00:05:12,540 --> 00:05:14,460
So hopefully that makes sense.

83
00:05:14,460 --> 00:05:21,930
So let's actually go inside the Leppert class and let's actually referred to this method here and now

84
00:05:21,990 --> 00:05:24,930
as you can see it says Return superb that stream.

85
00:05:24,960 --> 00:05:25,450
OK.

86
00:05:25,590 --> 00:05:28,280
So super refers to that superclass.

87
00:05:28,350 --> 00:05:35,550
So the superclass is chat's as you can see this is our Meffert that is inside this CAD class.

88
00:05:35,550 --> 00:05:38,920
So it's can actually execute this line of code here.

89
00:05:39,390 --> 00:05:40,110
OK.

90
00:05:40,350 --> 00:05:44,740
And then we can actually put a plus operator here.

91
00:05:44,880 --> 00:05:47,730
Strange dot format.

92
00:05:48,180 --> 00:05:51,720
And then inside the prentices I can just put in two double quotes here.

93
00:05:51,720 --> 00:05:57,420
First I need to actually specify the formatting instructions here and then we need to actually pass

94
00:05:57,510 --> 00:05:58,040
arguments.

95
00:05:58,050 --> 00:05:58,630
OK.

96
00:05:58,860 --> 00:06:03,390
So percent as Colan percent B.

97
00:06:03,840 --> 00:06:10,940
And then I put a comma here and then I put two double quotes in order to actually putting a string literal

98
00:06:10,950 --> 00:06:14,740
here in order to relate this string literal to these.

99
00:06:14,800 --> 00:06:16,450
US is talking here OK.

100
00:06:16,470 --> 00:06:17,680
Percent.

101
00:06:17,940 --> 00:06:24,330
So I can just typing class and then I actually put in a comma here and then I need to actually put in

102
00:06:24,330 --> 00:06:26,570
here an argument of type Boolean.

103
00:06:26,730 --> 00:06:28,120
So I can just refer.

104
00:06:28,380 --> 00:06:33,080
So here I just put in percent as Colan percent S OK.

105
00:06:33,210 --> 00:06:34,970
And then I put in a comma here.

106
00:06:35,280 --> 00:06:40,760
So first I need to actually put in a string literal here in order to relate this string literal to the

107
00:06:40,760 --> 00:06:45,430
spoken here person s so I can just type in class OK.

108
00:06:45,660 --> 00:06:53,310
And then I put in a comma here and then I need to actually again put in an argument of types here which

109
00:06:53,310 --> 00:06:56,920
we can relate that argument to this token here percent.

110
00:06:56,970 --> 00:06:57,700
OK.

111
00:06:58,140 --> 00:07:01,860
So this is our instance variable.

112
00:07:01,920 --> 00:07:05,710
So I can't just refer to this instance variable clause.

113
00:07:06,030 --> 00:07:09,300
So as you can see here now are twisting if it is ready.

114
00:07:09,300 --> 00:07:09,820
OK.

115
00:07:10,010 --> 00:07:16,050
But just one line of code we have managed to successfully put in our own implementations and then we

116
00:07:16,050 --> 00:07:21,050
can actually output the value of these value as art to the screen.

117
00:07:21,060 --> 00:07:21,500
OK.

118
00:07:21,540 --> 00:07:24,530
So here as you can see with it just typing here super.

119
00:07:24,530 --> 00:07:25,380
That was three.

120
00:07:25,560 --> 00:07:31,590
And then this can actually execute the implementation of steadily inside these two string Meffert inside

121
00:07:31,590 --> 00:07:32,410
this class.

122
00:07:32,430 --> 00:07:33,050
OK.

123
00:07:33,240 --> 00:07:36,740
So this is our implementation as you can see here.

124
00:07:36,750 --> 00:07:42,330
So let's actually go inside this main activity that Jawa here and then let's actually create an object

125
00:07:42,330 --> 00:07:42,770
from.

126
00:07:42,770 --> 00:07:43,690
Let's have the class.

127
00:07:43,710 --> 00:07:44,450
OK.

128
00:07:44,700 --> 00:07:52,940
So I can just type in here Leppert and the name of my object is my Leppert and and I put in an assignment

129
00:07:53,030 --> 00:07:54,310
operator here.

130
00:07:54,500 --> 00:07:57,070
New Leppert.

131
00:07:57,290 --> 00:08:01,610
And here we need to actually passing this instance these values here.

132
00:08:01,610 --> 00:08:02,170
OK.

133
00:08:02,300 --> 00:08:05,360
So the value of the first argument should be of types 3.

134
00:08:05,510 --> 00:08:09,010
And here we need to actually specify the name of our object.

135
00:08:09,050 --> 00:08:11,940
So I can't just put into double quotes here inside the double quotes.

136
00:08:11,960 --> 00:08:16,470
I can just type in my Leppert.

137
00:08:16,850 --> 00:08:17,640
OK.

138
00:08:18,110 --> 00:08:25,460
And then I put in a comma here and then I need to actually again put in a value of type string here.

139
00:08:25,670 --> 00:08:29,010
And here we need to actually specify the color of our leapers.

140
00:08:29,010 --> 00:08:29,640
OK.

141
00:08:29,810 --> 00:08:31,830
So I can't just put into double quotes here.

142
00:08:32,090 --> 00:08:40,550
For example yellow and then putting a comma here again as now I need to actually specify the amount

143
00:08:40,550 --> 00:08:43,000
of speed of our Leppert object.

144
00:08:43,010 --> 00:08:50,480
For example 400 and then putting a comma here and now I need to actually specify the amount of power

145
00:08:50,750 --> 00:08:52,700
of our Leppert here.

146
00:08:52,700 --> 00:08:58,690
So I can just put in a value of type Integer for example 200 comma.

147
00:08:59,060 --> 00:09:07,450
Now I need to specify the number of legs of our object which is of type int OK for comma.

148
00:09:08,030 --> 00:09:14,150
And now I need to actually specify that whether our object can hunt other animals or not.

149
00:09:14,390 --> 00:09:17,840
So as you can see here we need to actually put a value of type Boolean.

150
00:09:18,050 --> 00:09:19,880
So true or false.

151
00:09:19,910 --> 00:09:24,060
Ok so I can just type in true comma.

152
00:09:24,890 --> 00:09:31,100
And finally even if you actually specify the class of our object here.

153
00:09:31,140 --> 00:09:35,820
OK so I can't as you can see when need actually putting a value of type string.

154
00:09:35,960 --> 00:09:38,290
So I can just put it into double quotes here.

155
00:09:38,570 --> 00:09:44,180
And then inside the double quotes I can just type in sharp K and then I need to put in a semi-colon

156
00:09:44,420 --> 00:09:46,590
at the end of my statement.

157
00:09:46,610 --> 00:09:50,920
Now I can just type in here anti-X the leopard.

158
00:09:51,470 --> 00:09:53,360
That said text.

159
00:09:54,290 --> 00:10:00,960
And inside the parenthesis I can just refer to the name of this object my Lepard that too strange.

160
00:10:01,310 --> 00:10:04,090
Now we can run our project and see what happens.

