1
00:00:00,780 --> 00:00:08,600
So for example our this is our Get Real Meffert for for my Chan hunt other animals are instance valuable.

2
00:00:08,610 --> 00:00:09,100
OK.

3
00:00:09,240 --> 00:00:10,720
Can hunt other animals.

4
00:00:10,830 --> 00:00:13,330
I don't like this name so I just did it.

5
00:00:13,350 --> 00:00:14,530
This is here.

6
00:00:14,700 --> 00:00:17,860
And I just type in get can hunt other animals.

7
00:00:17,880 --> 00:00:18,510
OK.

8
00:00:18,840 --> 00:00:26,910
So as you can see here we've got acetyl my favorite for this can hunt other animals said can hunt other

9
00:00:26,910 --> 00:00:27,780
animals.

10
00:00:28,010 --> 00:00:28,720
OK.

11
00:00:29,130 --> 00:00:32,090
We've got a good term effort for this.

12
00:00:32,100 --> 00:00:35,480
Get a number of legs for instance variable here.

13
00:00:35,490 --> 00:00:39,900
This is the number of legs instance variable as you can see this is a constant.

14
00:00:39,900 --> 00:00:40,410
OK.

15
00:00:40,470 --> 00:00:47,060
So we cannot actually change the value of this instance valuable from another MFL or class.

16
00:00:47,130 --> 00:00:55,080
Once we give a value to this instance valuable OK so we only can actually create a getter method for

17
00:00:55,090 --> 00:00:58,080
this number of instance variable.

18
00:00:58,090 --> 00:00:59,690
OK because this is a constant.

19
00:00:59,850 --> 00:01:05,700
So as you can see here the Android studio only generated a get fit for this number of likes instance

20
00:01:05,700 --> 00:01:06,450
variable.

21
00:01:06,510 --> 00:01:09,080
We don't have any search term for this.

22
00:01:09,110 --> 00:01:13,500
A number of instance variable OK this is only our Get help method.

23
00:01:13,590 --> 00:01:18,580
OK publish and get a number of leks returnable Oblak number of links.

24
00:01:18,750 --> 00:01:26,910
And here we have this gets amount of power methhead as you can see this is a good fit for the amount

25
00:01:26,910 --> 00:01:28,790
of power instance variable.

26
00:01:29,000 --> 00:01:29,810
OK.

27
00:01:30,270 --> 00:01:34,220
And this is a settlement worth for the amount of power instance variable.

28
00:01:34,260 --> 00:01:39,120
This is our Get and my faith for the for the amount of speed instance variable.

29
00:01:39,360 --> 00:01:44,510
And this is a set in my faith for the amount of spit instance variable and we've got these two getter

30
00:01:44,520 --> 00:01:51,100
methods for the color instance variable and for the name instance variable as you can see here these

31
00:01:51,100 --> 00:01:53,490
two instance variables are constants.

32
00:01:53,550 --> 00:01:54,220
Okay.

33
00:01:54,540 --> 00:02:00,180
So as you can see here we cannot change the value of these two instance variables from another method

34
00:02:00,450 --> 00:02:01,260
or class.

35
00:02:01,260 --> 00:02:04,700
Once we give a value to these instance variables.

36
00:02:04,770 --> 00:02:11,260
So the Android studio only generated a getter method for these instance variables here.

37
00:02:11,270 --> 00:02:12,020
OK.

38
00:02:12,480 --> 00:02:13,800
Get caller get name.

39
00:02:13,830 --> 00:02:17,310
OK we don't have a certain method for these instance variables here.

40
00:02:17,310 --> 00:02:17,660
OK.

41
00:02:17,740 --> 00:02:24,660
We cannot create a certain method for this instance variables because we declared these instance variables

42
00:02:25,170 --> 00:02:26,410
as constant.

43
00:02:26,510 --> 00:02:27,110
OK.

44
00:02:27,360 --> 00:02:28,980
So hopefully that makes sense.

45
00:02:29,250 --> 00:02:36,840
And let's actually go inside the main activity that Java here and now I want to actually output some

46
00:02:36,840 --> 00:02:38,300
text to the screen.

47
00:02:38,340 --> 00:02:38,940
OK.

48
00:02:39,420 --> 00:02:44,800
So here I just need to create an object from the cat class.

49
00:02:44,820 --> 00:02:51,420
So first of all I just need to refer to the name of the class and the name of my object is Chatz one.

50
00:02:51,870 --> 00:03:01,600
And then I put an assignment operator here and then I actually put this key word here Neal chat's as

51
00:03:01,600 --> 00:03:04,820
you can see here and it inside the here.

52
00:03:04,960 --> 00:03:07,990
I need to actually passing some values as you can see here.

53
00:03:07,990 --> 00:03:10,320
String name string color.

54
00:03:10,470 --> 00:03:13,120
I'm out of speed in amount of power.

55
00:03:13,120 --> 00:03:17,280
Number of legs and this boolean variable can hunt other animals.

56
00:03:17,290 --> 00:03:17,950
OK.

57
00:03:18,140 --> 00:03:25,660
So we actually create on an object for the chad class the constructor of these class is going to be

58
00:03:25,660 --> 00:03:26,070
called.

59
00:03:26,080 --> 00:03:27,730
OK so this is the constructor.

60
00:03:27,820 --> 00:03:30,430
So we need to actually pass those values here.

61
00:03:30,550 --> 00:03:32,270
Here inside Apprentice's.

62
00:03:32,290 --> 00:03:32,800
OK.

63
00:03:32,950 --> 00:03:37,580
So first of all I need to actually pass a value of type string.

64
00:03:37,780 --> 00:03:42,480
As you can see here inside the cathe class the first argument is of types 3 and.

65
00:03:42,590 --> 00:03:44,360
And the name of this argument is name.

66
00:03:44,410 --> 00:03:47,470
So we need to actually give a name to this chat object.

67
00:03:47,620 --> 00:03:52,050
So I just need to put in two double calls here and then inside the table Cotes.

68
00:03:52,150 --> 00:03:54,880
I can't actually just type in a name.

69
00:03:54,880 --> 00:04:07,270
For example my chat the name of my cat is cat object is my cat comma and the value for the second argument

70
00:04:07,270 --> 00:04:16,250
must be again as three in value as you can see inside the class the data type of this argument is our

71
00:04:16,400 --> 00:04:19,370
strength and the name of this argument is color.

72
00:04:19,390 --> 00:04:22,170
So we need to actually specify the color of an object.

73
00:04:22,210 --> 00:04:25,020
So let's go back and say the main activity that Java here.

74
00:04:25,150 --> 00:04:33,640
I just need to put into double quotes and for example the color of my cat is white and then I put a

75
00:04:33,640 --> 00:04:38,710
comma here and then I need to actually specify my first argument here.

76
00:04:38,770 --> 00:04:41,960
So let's go back inside the cat the java file.

77
00:04:42,010 --> 00:04:48,980
As you can see my first argument is of type integer and the name of my argument is amount of speed.

78
00:04:49,060 --> 00:04:52,080
So we need to actually pass a value of like integer.

79
00:04:52,090 --> 00:04:56,390
So for example the speed of my chat is 40.

80
00:04:56,710 --> 00:04:57,210
OK.

81
00:04:57,280 --> 00:04:59,710
And then I need to actually put a comma here.

82
00:04:59,980 --> 00:05:05,920
So here I need to actually specify the fourth argument for my constructor here.

83
00:05:05,980 --> 00:05:11,490
So let's go back and say the cat the java file as you can see our forth argument is of type integer

84
00:05:11,800 --> 00:05:13,470
and the name of my argument is.

85
00:05:13,460 --> 00:05:14,590
Amount of power.

86
00:05:14,650 --> 00:05:18,830
So I need to specify the amount of power of my cat object.

87
00:05:18,850 --> 00:05:22,030
For example 40 karma.

88
00:05:22,420 --> 00:05:25,550
And here we need to actually specify the fefe argument.

89
00:05:25,690 --> 00:05:30,790
So let's go back and say they kept the chatter of a fight here and we need to actually specify the number

90
00:05:30,790 --> 00:05:33,310
of legs for our chat object.

91
00:05:33,310 --> 00:05:37,870
The number of legs of my cat object is four comma.

92
00:05:38,500 --> 00:05:41,950
And let's actually go back in say the cat fight again.

93
00:05:42,100 --> 00:05:44,910
And here we need to actually specify our last argument.

94
00:05:44,920 --> 00:05:45,560
OK.

95
00:05:45,730 --> 00:05:51,670
Which is of type Boolean and the name of our argument is can hunt other animals.

96
00:05:51,730 --> 00:05:59,050
So let's go back and say the main activity that over here for example troll or cat object can hunt other

97
00:05:59,260 --> 00:05:59,740
animals.

98
00:05:59,740 --> 00:06:00,090
OK.

99
00:06:00,100 --> 00:06:04,130
As you can see here I want to actually output these values to the screen.

100
00:06:04,210 --> 00:06:07,300
So let's go back inside to catch up the job fight here.

101
00:06:07,330 --> 00:06:15,430
As you can see here we didn't actually overwrite the two strange Mefford that that is inside the Object

102
00:06:15,430 --> 00:06:15,750
class.

103
00:06:15,780 --> 00:06:22,640
OK so as you can see here this cat class implicitly inherits from the Object class.

104
00:06:22,660 --> 00:06:23,220
OK.

105
00:06:23,470 --> 00:06:30,520
So if you want to actually explicitly say that this cathe class inherits from the Object class I just

106
00:06:30,520 --> 00:06:34,240
need to type in here extents object.

107
00:06:34,260 --> 00:06:42,520
OK but if we don't put these two words here are Kathe class is going to implicitly inherit from the

108
00:06:42,610 --> 00:06:43,320
Object class.

109
00:06:43,330 --> 00:06:43,660
OK.

110
00:06:43,660 --> 00:06:50,710
This cat class inherits all of the features and behaviors that are inside the Object class.

111
00:06:50,830 --> 00:06:56,470
So inside the main activity that Java here if you want to actually call that to string method let's

112
00:06:56,470 --> 00:06:57,340
see what happens.

113
00:06:57,340 --> 00:07:05,910
T XTi chat that said text chat's one dot to.

114
00:07:06,940 --> 00:07:10,010
As you can see here inside the Chatta class.

115
00:07:10,120 --> 00:07:10,690
We didn't.

116
00:07:10,720 --> 00:07:11,730
All right.

117
00:07:11,740 --> 00:07:13,190
That was Thring method here.

118
00:07:13,210 --> 00:07:13,900
OK.

119
00:07:13,900 --> 00:07:19,130
We are just calling our Smurfette to a stream that is inside the object class.

120
00:07:19,150 --> 00:07:19,870
OK.

121
00:07:19,870 --> 00:07:22,990
So let's actually run our project and see what happens.

122
00:07:22,990 --> 00:07:26,550
So as you can see here it only put this value here.

123
00:07:26,600 --> 00:07:31,620
OK the name of our package at sign and this number OK.

124
00:07:31,690 --> 00:07:42,130
So let's actually go back inside our chat class and let's actually find the string method that is inside

125
00:07:42,130 --> 00:07:42,960
the Object class.

126
00:07:42,970 --> 00:07:43,570
OK.

127
00:07:43,570 --> 00:07:52,480
So let's actually put this extents object here and then hold the command key on your keyboard and then

128
00:07:52,630 --> 00:07:54,010
click on this object class.

129
00:07:54,070 --> 00:07:59,830
Here if you are using of those machine you need to actually hold the control key on your keyboard and

130
00:07:59,830 --> 00:08:04,350
then click on that object class here instead of math class.

131
00:08:04,360 --> 00:08:04,830
OK.

132
00:08:04,930 --> 00:08:07,400
So as you can see here this is our object class.

133
00:08:07,420 --> 00:08:14,020
So in order to find the string method I just need to actually press on command key plus the f he on

134
00:08:14,020 --> 00:08:15,060
my keyboard.

135
00:08:15,280 --> 00:08:21,200
If you are using a Windows machine you need to actually press on control key plus the key on your keyboard.

136
00:08:21,220 --> 00:08:26,510
And here I can search for it for the method names or for there are two other keyboards.

137
00:08:26,550 --> 00:08:29,410
OK the name of my method is to streambed.

138
00:08:30,070 --> 00:08:34,960
So as you can see here these are two string Meffert OK return gets class.

139
00:08:34,960 --> 00:08:37,070
So let's actually see what's in the emulator.

140
00:08:37,090 --> 00:08:38,800
So this is our emulator OK.

141
00:08:39,010 --> 00:08:43,130
Return get class that get named.

142
00:08:43,810 --> 00:08:47,120
As you can see here this is the name of the package.

143
00:08:47,210 --> 00:08:50,130
Our project this chat here is the name of our class.

144
00:08:50,140 --> 00:08:53,740
OK so return gueth class that get name it returns.

145
00:08:53,810 --> 00:08:55,390
Are this a value here.

146
00:08:55,630 --> 00:08:59,750
The name of our class at sign integer to Hexe.

147
00:08:59,770 --> 00:09:05,560
Strange as you can see here this code here is the result of these quotes here.

148
00:09:05,560 --> 00:09:05,810
OK.

149
00:09:05,830 --> 00:09:08,900
Integer the two hex string hash code.

150
00:09:09,130 --> 00:09:14,010
Ok so you don't need to know whether these are actually values.

151
00:09:14,140 --> 00:09:19,090
I just wanted to show you that this is the default implementation of these Smurfette.

152
00:09:19,270 --> 00:09:27,370
So in order to actually output these values these values that you specified for this chat object to

153
00:09:27,370 --> 00:09:32,300
the screen we need to actually overwrite that to a string method here.

154
00:09:32,500 --> 00:09:39,980
So I just need to type in here to stream as you can see the autocomplete feature of the Android studio

155
00:09:40,230 --> 00:09:41,970
helps us to find that Meffert here.

156
00:09:41,970 --> 00:09:42,510
Okay.

157
00:09:42,570 --> 00:09:46,140
And then I just need to press on return key on my keyboard.

158
00:09:46,240 --> 00:09:51,220
Or if you are using a Windows machine you need to actually press on Enter key on your keyboard.

159
00:09:51,420 --> 00:09:57,630
So as you can see here this is arm twisting method and as you can see it is outside of a right.

160
00:09:57,630 --> 00:10:00,350
Q What here means that we are all the radio.

161
00:10:00,390 --> 00:10:03,510
Or redefining our Meffert that is inside the superclass.

