1
00:00:00,120 --> 00:00:00,630
OK.

2
00:00:00,810 --> 00:00:06,340
Now let's actually creates a getter method for this name instance variable.

3
00:00:06,450 --> 00:00:10,160
And remember that this instance variable is a constant.

4
00:00:10,170 --> 00:00:10,870
OK.

5
00:00:11,010 --> 00:00:16,300
So we cannot change the value of this instance variable from another method or class.

6
00:00:16,500 --> 00:00:19,350
So here I need to only create a good head Smurfette.

7
00:00:19,360 --> 00:00:25,650
OK not a setter my it because we cannot change the value of this instance variable once we assign a

8
00:00:25,650 --> 00:00:27,690
value to this instance variable.

9
00:00:27,730 --> 00:00:33,980
Ok so first of all I need to specify the axis modifier of this get RMF it public.

10
00:00:34,370 --> 00:00:35,010
OK.

11
00:00:35,340 --> 00:00:43,080
And here I need to specify the return type of this term if it is 3 and the name of this never is gets

12
00:00:44,580 --> 00:00:45,190
name.

13
00:00:45,450 --> 00:00:46,260
OK.

14
00:00:46,740 --> 00:00:51,240
And then I need to put in a pair of round brackets after my first name and then I need to open and close

15
00:00:51,240 --> 00:00:53,580
my method by using these curly braces.

16
00:00:53,580 --> 00:00:54,100
OK.

17
00:00:54,390 --> 00:00:55,090
So here.

18
00:00:55,140 --> 00:01:02,790
So inside the Mefford now I need to return the value of this name instance variable OK.

19
00:01:03,720 --> 00:01:09,960
So as you can see here this is OUR get and my faith for this name instance variable and we don't need

20
00:01:09,960 --> 00:01:15,870
to actually create a certain method for this instance variable because because this instance value is

21
00:01:15,870 --> 00:01:22,470
a constant and we cannot change the value of this instance variable from another method or class OK

22
00:01:22,860 --> 00:01:29,670
we just need to create a get in effect in order to allow other classes to access the value of these

23
00:01:30,560 --> 00:01:32,150
name instance variable.

24
00:01:32,160 --> 00:01:32,800
OK.

25
00:01:32,970 --> 00:01:37,340
So again we need a good head on my faith for this color instance variable.

26
00:01:37,500 --> 00:01:44,190
So the access modifier of this are get him if it is public and the return type of the Smurfette is a

27
00:01:44,190 --> 00:01:49,650
strange and the name of this method is get color OK.

28
00:01:49,890 --> 00:01:53,430
And then I need to actually put in a paragraph brackets after my method name.

29
00:01:53,640 --> 00:02:00,150
And then I need to open and close my method by using these curly braces inside them if I can just return

30
00:02:01,080 --> 00:02:04,040
the color instance value.

31
00:02:04,050 --> 00:02:05,180
OK.

32
00:02:05,790 --> 00:02:08,570
So as you can see here these are the Get help efforts.

33
00:02:08,670 --> 00:02:12,330
These are they get hairs for instance variables.

34
00:02:12,360 --> 00:02:19,280
So here I want to actually create a get here and a setter for this amount of speed instance variable.

35
00:02:19,440 --> 00:02:22,770
So as you can see here this instance variable is not a constant.

36
00:02:22,770 --> 00:02:23,190
OK.

37
00:02:23,340 --> 00:02:30,210
So we can actually create a set in my foot in order to allow that other classes you know to change the

38
00:02:30,210 --> 00:02:32,240
value of this instance variable.

39
00:02:32,460 --> 00:02:37,250
So first I create a certain my faith for this amount of speed instance variable.

40
00:02:37,560 --> 00:02:44,650
So the access modifier of this method is public and the return type of this method is voit.

41
00:02:45,190 --> 00:02:45,910
OK.

42
00:02:46,430 --> 00:02:49,720
And then the name of this novel is set amount of speed.

43
00:02:50,180 --> 00:02:55,640
And then I need to actually put in a pair of round black kids after my Meffert name and then inside

44
00:02:55,640 --> 00:03:01,520
the apprentice's I need to actually specify that this is going to actually accept an argument of type

45
00:03:01,580 --> 00:03:07,050
int and the name of this argument is you ok.

46
00:03:07,130 --> 00:03:12,550
It can be amount of speed to for example amount amount of speed.

47
00:03:12,640 --> 00:03:13,150
OK.

48
00:03:13,280 --> 00:03:16,600
And then I need to open and close my method by using these curly braces.

49
00:03:16,760 --> 00:03:24,940
So now inside I'm afraid I can't just putting this key vote that amount of speed assignment operator.

50
00:03:25,100 --> 00:03:25,910
Amount of speed.

51
00:03:25,940 --> 00:03:26,460
OK.

52
00:03:26,660 --> 00:03:32,390
So because these are the name of the name of this argument is the same as this is the same as the name

53
00:03:32,390 --> 00:03:33,950
of this instance variable.

54
00:03:34,070 --> 00:03:41,240
I needed to put this key word here in order to refer to this instance variable here and then I put an

55
00:03:41,300 --> 00:03:46,760
assignment operator here and then I assigned this argument to this instance variable.

56
00:03:46,840 --> 00:03:47,200
OK.

57
00:03:47,210 --> 00:03:48,980
In this video I made a mistake.

58
00:03:49,010 --> 00:03:49,470
OK.

59
00:03:49,550 --> 00:03:52,520
And here I want to actually fix these mistakes.

60
00:03:52,550 --> 00:03:59,980
First of all inline 20 are actually assigned at this amount of speed argument to this amount of power

61
00:03:59,990 --> 00:04:00,990
instance variable.

62
00:04:01,000 --> 00:04:01,850
And this is wrong.

63
00:04:02,060 --> 00:04:06,160
I should actually FAIL to this amount of power argument to name.

64
00:04:06,260 --> 00:04:08,540
So I actually to type in amount of power.

65
00:04:08,570 --> 00:04:09,260
OK.

66
00:04:09,710 --> 00:04:14,830
And the next mistake that I made is in this method set amount of speed first.

67
00:04:14,870 --> 00:04:21,710
I actually deferred to the name of the the name of this amount of power instance variable and this is

68
00:04:21,710 --> 00:04:22,250
right.

69
00:04:22,310 --> 00:04:26,970
This left is for actually sitting values to this amount of spit instance variable.

70
00:04:26,970 --> 00:04:31,120
So change the name of this instance variable to amount of speed.

71
00:04:31,440 --> 00:04:32,120
OK.

72
00:04:32,180 --> 00:04:37,820
And then as you can see here we are actually assigning this amount of speed argument to this amount

73
00:04:37,820 --> 00:04:39,310
of speed instance variable.

74
00:04:39,320 --> 00:04:42,170
Ok so now we actually fixed these mistakes.

75
00:04:42,170 --> 00:04:42,830
OK.

76
00:04:42,980 --> 00:04:47,840
So make sure that you actually assign this argument to this amount of speed instance variable in this

77
00:04:47,840 --> 00:04:48,150
method.

78
00:04:48,170 --> 00:04:48,790
OK.

79
00:04:49,130 --> 00:04:56,610
So here again I create another get my faith for this is amount of speed instance valuable public.

80
00:04:56,780 --> 00:05:01,480
And as you can see the return type of this method is of type int.

81
00:05:01,550 --> 00:05:02,040
OK.

82
00:05:02,210 --> 00:05:06,260
As you can see the data type of this instance variable is it.

83
00:05:06,290 --> 00:05:11,210
So we need to actually turn a value of type int from this I get head Meffert.

84
00:05:11,210 --> 00:05:11,910
OK.

85
00:05:12,260 --> 00:05:19,580
So publish it gets amount of speed and then I need to put in a pair of round brackets after my Meffert

86
00:05:19,580 --> 00:05:20,010
name.

87
00:05:20,180 --> 00:05:24,370
And then I need to open and close my effect by using these curly braces here.

88
00:05:24,380 --> 00:05:30,400
I just need to return the value of this amount of speed instance variable OK.

89
00:05:31,190 --> 00:05:38,240
So again I actually create a set in my head for this amount of power instance variable.

90
00:05:38,540 --> 00:05:41,570
So I just need to type in here public.

91
00:05:42,890 --> 00:05:49,470
And the return type of this method is void and the name of this method is set amount of power.

92
00:05:49,760 --> 00:05:53,240
And then I need to put in I've had around brackets after of my name.

93
00:05:53,240 --> 00:06:00,210
So here I want to specify that this is going to actually accept an argument of type int So here the

94
00:06:00,210 --> 00:06:04,160
data type of the argument is int and the name of this argument is.

95
00:06:04,170 --> 00:06:05,120
Amount of power.

96
00:06:05,140 --> 00:06:06,310
OK.

97
00:06:06,350 --> 00:06:10,010
And then I need to open and close my method by using these curly braces.

98
00:06:10,220 --> 00:06:13,110
So inside I'm afraid I just live in these thoughts.

99
00:06:13,370 --> 00:06:16,760
I'm out of power assignments operator.

100
00:06:16,880 --> 00:06:17,860
Amount of power.

101
00:06:17,870 --> 00:06:18,810
OK.

102
00:06:19,370 --> 00:06:23,610
So this is our set and my faith for the amount of power instance variable.

103
00:06:23,990 --> 00:06:30,310
And then I need to actually create or get home fit for this instance variable amount of power.

104
00:06:30,470 --> 00:06:35,480
So public and the return type of This Is It.

105
00:06:35,960 --> 00:06:40,120
And the name of this method is gets amount of power.

106
00:06:40,160 --> 00:06:43,290
And then I need to put in a pair of hands brackets after my name.

107
00:06:43,340 --> 00:06:47,910
And then I need to actually open and close my method by using the curly braces.

108
00:06:47,930 --> 00:06:56,150
So here I just need to return the value of this amount of power instance variable amount of power instance

109
00:06:56,160 --> 00:06:56,600
variable.

110
00:06:56,660 --> 00:07:03,830
Ok so now I created the guitarist and the setters for these instance variables.

111
00:07:04,010 --> 00:07:07,280
So now I want to actually redefine.

112
00:07:07,580 --> 00:07:17,870
So now I want to actually redefine a method that is actually inside the object class extends object.

113
00:07:17,870 --> 00:07:26,060
So this object class has some methods and variables and this animal class can actually access those

114
00:07:26,250 --> 00:07:32,240
are methods or variables because this animal class actually inherits all the behaviors and features

115
00:07:32,240 --> 00:07:33,820
of this object class.

116
00:07:33,840 --> 00:07:35,160
Ok by default.

117
00:07:35,300 --> 00:07:41,480
And here are I just wanted to show you that this animal class actually inherits all of these behaviors

118
00:07:41,510 --> 00:07:42,200
by default.

119
00:07:42,230 --> 00:07:42,640
OK.

120
00:07:42,650 --> 00:07:49,430
So in order to actually access behaviors that are inside this object class I can just refer to the name

121
00:07:49,430 --> 00:07:50,750
of those methods.

122
00:07:50,750 --> 00:08:00,140
So for example to a strange as you can see this is a method that is inside this object class.

123
00:08:00,240 --> 00:08:08,340
Attari and this override key word here means that we are redefining or overriding a method that is inside

124
00:08:08,340 --> 00:08:09,200
this object class.

125
00:08:09,210 --> 00:08:09,820
OK.

126
00:08:09,840 --> 00:08:15,920
And here I can actually put my own instructions my own implementations inside this method.

127
00:08:15,930 --> 00:08:16,720
OK.

128
00:08:17,280 --> 00:08:23,460
So this is how we can actually access the behaviors that are inside the class that we are inheriting

129
00:08:23,460 --> 00:08:23,830
from.

130
00:08:23,900 --> 00:08:30,960
OK so if we actually delete these two words here as you can see it's going to actually show us enough

131
00:08:31,010 --> 00:08:38,190
no errors because by default this animal class is actually inheriting all of the behaviors and features

132
00:08:38,430 --> 00:08:41,380
that are inside the inside the object class.

133
00:08:41,400 --> 00:08:41,770
OK.

134
00:08:41,790 --> 00:08:46,630
And here as you can see that the access modified of the Smurfette is public.

135
00:08:46,890 --> 00:08:52,420
The return type of this method is a string and the name of this method is too strange.

136
00:08:52,430 --> 00:08:58,770
OK so now let's actually go inside the object class in order to find these two string method.

137
00:08:58,770 --> 00:08:59,280
OK.

138
00:08:59,520 --> 00:09:06,510
So here I just need to type extents object and then and then hold the command key and then click on

139
00:09:06,510 --> 00:09:07,980
this object class.

140
00:09:08,100 --> 00:09:10,440
And here you are to actually find the two is three Meffert.

141
00:09:10,440 --> 00:09:10,990
OK.

142
00:09:11,100 --> 00:09:18,780
So in order to actually find a method or a specific keyword in your classes if you are using too much

143
00:09:18,780 --> 00:09:23,890
or six you just need to hold the command key plus the key on your keyboard.

144
00:09:24,060 --> 00:09:30,060
Or if you are using any of those machine you need to actually hold the control key plus the key on your

145
00:09:30,060 --> 00:09:30,480
keyboard.

146
00:09:30,490 --> 00:09:30,840
OK.

147
00:09:30,930 --> 00:09:36,610
I can actually search for my method names or keywords for example to a string.

148
00:09:37,650 --> 00:09:39,940
So as you can see here this is this two string Meffert.

149
00:09:39,960 --> 00:09:40,520
OK.

150
00:09:40,530 --> 00:09:46,530
And these are some of the comments that are actually explaining the functionalities of these two unstring

151
00:09:46,530 --> 00:09:47,370
Meffert OK.

152
00:09:47,580 --> 00:09:53,940
So as you can see here it says it returns a syringe containing a concise human readable description

153
00:09:53,970 --> 00:09:54,960
of this object.

154
00:09:54,960 --> 00:09:55,960
OK.

155
00:09:56,400 --> 00:10:04,860
Subclasses are encouraged to override the Smurfette and provide an implementation that takes into account

156
00:10:04,920 --> 00:10:07,480
the object's type and data.

157
00:10:07,590 --> 00:10:14,040
OK the default implementation is equivalent to the following expression as you can see it is this is

158
00:10:14,040 --> 00:10:18,720
the expression that is the default implementation of this Nefert.

159
00:10:18,720 --> 00:10:25,000
OK that's class that gets named plus add sign plus integer data to hex strange.

160
00:10:25,170 --> 00:10:27,760
And then inside the apprentice's as you can see hash code.

161
00:10:27,860 --> 00:10:28,230
OK.

