1
00:00:00,180 --> 00:00:05,230
So first of all let me comment with this line of code here because I don't want to execute it.

2
00:00:05,340 --> 00:00:13,280
So I want to actually access the value of this valuable that I created in this law and class.

3
00:00:13,290 --> 00:00:13,880
OK.

4
00:00:13,920 --> 00:00:20,640
So inside the main class you want to actually output the value of the speech value that I created inside

5
00:00:20,640 --> 00:00:23,480
the lion class onto the console.

6
00:00:23,610 --> 00:00:24,950
So how can I do that.

7
00:00:24,990 --> 00:00:26,010
So how can I do that.

8
00:00:26,010 --> 00:00:32,400
First of all I just need to take Here system that's out print to learn and then inside the apprentice's

9
00:00:32,850 --> 00:00:35,850
I just need to refer to the name of my object.

10
00:00:35,850 --> 00:00:40,980
First of all OK and then I use the dot notation here.

11
00:00:41,430 --> 00:00:47,730
And as you can see it's going to actually show us the speed valuable that I created inside the lion

12
00:00:47,730 --> 00:00:48,070
class.

13
00:00:48,090 --> 00:00:48,780
OK.

14
00:00:49,110 --> 00:00:52,120
It is now recommending us to choose this option.

15
00:00:52,230 --> 00:00:57,760
So the name of our barrier is speed that data type are valuable is it.

16
00:00:57,870 --> 00:01:00,810
And this variable is inside the client class.

17
00:01:01,000 --> 00:01:07,170
OK so if I use speed and then at the end of my statement I put a semicolon.

18
00:01:07,500 --> 00:01:12,210
So now if I get on my project as you can see it's going out with this value to the console.

19
00:01:12,210 --> 00:01:12,950
OK.

20
00:01:13,230 --> 00:01:19,970
So this value is the value of this valuable that I created inside the client class.

21
00:01:20,040 --> 00:01:27,100
Ok this variable is dedicated for the instances that we create from this law class.

22
00:01:27,120 --> 00:01:27,800
OK.

23
00:01:28,170 --> 00:01:37,160
Here we are actually creating an instance from this client class and in line 14 we are actually outputting

24
00:01:37,470 --> 00:01:43,290
the value of this value in the value of this variable that we created inside the lion class.

25
00:01:43,290 --> 00:01:48,760
So now let me show you that you can actually change the value of that speed variable.

26
00:01:48,960 --> 00:01:56,130
So first of all I need to refer to the name of my object my line and then dot and then I choose this

27
00:01:56,320 --> 00:01:57,380
variable.

28
00:01:57,870 --> 00:02:02,180
And then I can assign another value to my valuable for example number 80.

29
00:02:02,280 --> 00:02:06,130
And then at the end of my statement I need to put in a semi-colon.

30
00:02:06,150 --> 00:02:12,930
So now if I want to output the value of my Spizz valuable to the console I just need to type in her

31
00:02:12,930 --> 00:02:22,060
system that out that print land and then inside the prentices I can my life in that speech.

32
00:02:22,290 --> 00:02:23,010
OK.

33
00:02:23,010 --> 00:02:25,860
And then at the end of my statement I need to put in a semicolon.

34
00:02:25,890 --> 00:02:31,770
So first of all let me actually put a text here or there to specify that the value of my line object

35
00:02:31,830 --> 00:02:33,210
is actually changed.

36
00:02:33,210 --> 00:02:39,870
So I just need to put into double quotes here and then I use the plus operator here in order to actually

37
00:02:39,870 --> 00:02:42,340
concatenate this object to my text.

38
00:02:42,360 --> 00:02:42,960
OK.

39
00:02:43,110 --> 00:02:55,810
So inside the double quotes just type in here this is the value of the speed variable of my line object.

40
00:02:56,430 --> 00:02:57,210
OK.

41
00:02:57,480 --> 00:03:02,460
And if I run my project as you can see it's going to output this value to the counselor OK.

42
00:03:02,640 --> 00:03:06,640
This is the value of this valuable of my line an object number 80.

43
00:03:06,710 --> 00:03:12,200
OK so let me actually create another object here.

44
00:03:12,270 --> 00:03:12,960
OK.

45
00:03:12,960 --> 00:03:18,980
So again in order to create another object from this law class I just need to type in here relion.

46
00:03:19,300 --> 00:03:19,940
OK.

47
00:03:20,190 --> 00:03:26,660
The name of my object is my second line.

48
00:03:26,970 --> 00:03:27,930
OK.

49
00:03:27,930 --> 00:03:31,430
And then I use an assignment operator here.

50
00:03:31,650 --> 00:03:36,040
And then I use then you convert and then I'll refer to the name of my class.

51
00:03:36,120 --> 00:03:42,540
And then after the class name I put a pair of round brackets and then I put semicolon at the end of

52
00:03:42,540 --> 00:03:43,530
my statement.

53
00:03:43,600 --> 00:03:44,180
OK.

54
00:03:44,430 --> 00:03:47,740
So as you can see here are second the lion is now created.

55
00:03:47,910 --> 00:03:55,500
So now in order to make sure that our line is created and it is stored in silver inside the memory I

56
00:03:55,500 --> 00:04:03,450
just need to type in here system that out that print land and then inside the practices I can just refer

57
00:04:03,450 --> 00:04:05,630
to the name of my second line object.

58
00:04:05,640 --> 00:04:06,530
OK.

59
00:04:06,930 --> 00:04:10,140
And then at the end of my statement I need to put in a semicolon.

60
00:04:10,140 --> 00:04:19,500
So now if I run my project as you can see this is the address of our second line object inside the memory.

61
00:04:19,530 --> 00:04:23,390
OK so let me actually comment out this line of code here.

62
00:04:23,430 --> 00:04:31,580
And now I want to actually output the value of this valuable for this instance of the line class to

63
00:04:31,600 --> 00:04:32,620
the K..

64
00:04:32,700 --> 00:04:40,410
So I just need to type in here system that out that print line inside Apprentice's.

65
00:04:40,620 --> 00:04:44,450
I just need to refer to the name of my second line object.

66
00:04:44,490 --> 00:04:46,730
So here I just need to type in here my.

67
00:04:46,860 --> 00:04:53,670
And then I use the autocomplete feature of the eclipse and then I choose the my second line object here.

68
00:04:53,820 --> 00:05:01,340
And then I posted the dotted notation here and here I can actually access this area of this like an

69
00:05:01,370 --> 00:05:01,880
object.

70
00:05:01,910 --> 00:05:02,510
OK.

71
00:05:02,870 --> 00:05:08,150
So if I choose this variable i need to put a semicolon at the end of my statement.

72
00:05:08,150 --> 00:05:14,050
So now if I had on my project as you can see the value of this value is now 100.

73
00:05:14,060 --> 00:05:14,790
OK.

74
00:05:15,020 --> 00:05:24,430
So as you can see here in line 15 I actually changed the value of this space variable for my client

75
00:05:24,470 --> 00:05:24,870
object.

76
00:05:24,890 --> 00:05:25,520
OK.

77
00:05:26,290 --> 00:05:32,740
But this sweet valley Bell is actually a copy of this speech.

78
00:05:32,740 --> 00:05:33,570
Valuable here.

79
00:05:33,580 --> 00:05:37,210
OK we are not actually changing the actual value.

80
00:05:37,300 --> 00:05:43,400
We are actually changing the value of a copy of this value.

81
00:05:43,410 --> 00:05:43,770
OK.

82
00:05:43,810 --> 00:05:50,740
This variable is dedicated specifically for every instance that we create from this class.

83
00:05:50,740 --> 00:05:51,280
OK.

84
00:05:51,550 --> 00:06:01,060
So if I for example changed the value of these spent valuable in line 15 it doesn't mean that we actually

85
00:06:01,060 --> 00:06:06,610
changed the value of these Spaeth valuable that we created inside the client class.

86
00:06:06,610 --> 00:06:09,690
We only changed the value of this variable.

87
00:06:09,700 --> 00:06:13,150
That is only for my client object here.

88
00:06:13,150 --> 00:06:19,520
OK but here in line 19 I decided to create another object from this line class.

89
00:06:19,660 --> 00:06:20,180
OK.

90
00:06:20,230 --> 00:06:25,720
And inside the main class I actually tried to output the value of this variable for this.

91
00:06:25,720 --> 00:06:28,060
My second line object to the console.

92
00:06:28,090 --> 00:06:28,460
OK.

93
00:06:28,480 --> 00:06:31,260
So as you can see here this value is 100.

94
00:06:31,380 --> 00:06:37,150
OK so this variable is actually a copy of this value.

95
00:06:37,180 --> 00:06:37,580
OK.

96
00:06:37,580 --> 00:06:46,240
When you actually access this variable from another class we are actually creating a copy of that variable

97
00:06:46,540 --> 00:06:47,550
here.

98
00:06:47,590 --> 00:06:54,310
So here if I for example want to change the speed of my second line object to another value I can just

99
00:06:54,310 --> 00:06:55,120
type in here.

100
00:06:55,240 --> 00:06:56,890
My second line.

101
00:06:57,240 --> 00:06:57,900
OK.

102
00:06:58,020 --> 00:06:59,510
That speed.

103
00:06:59,680 --> 00:07:04,280
And then I can assign another value to my variable for example number 30.

104
00:07:04,450 --> 00:07:07,710
And then at the end of my statement I need to put in a semicolon.

105
00:07:07,720 --> 00:07:16,490
So now if I want to output this value to the console I just need to type in her system that out that

106
00:07:16,630 --> 00:07:17,380
print Len

107
00:07:20,590 --> 00:07:27,460
and then inside the prentices I can just type in here my second line in that speech.

108
00:07:27,760 --> 00:07:28,350
OK.

109
00:07:28,540 --> 00:07:31,900
And then at the end of my statement I need to put in a semicolon.

110
00:07:31,930 --> 00:07:38,980
So now if I run my project as you can see the value of this bit valuable of this my second line object

111
00:07:39,010 --> 00:07:40,370
is now 50.

112
00:07:40,520 --> 00:07:41,050
OK.

113
00:07:41,110 --> 00:07:46,360
But the value of this sweet valuable of my life object is 80.

114
00:07:46,360 --> 00:07:46,930
OK.

115
00:07:46,990 --> 00:07:53,860
So when we actually access this valuable that we created inside this class from another class we are

116
00:07:53,860 --> 00:07:58,230
actually making another copy of that variable in our class.

117
00:07:58,240 --> 00:08:02,330
So because of that this variable is called instance variable.

118
00:08:02,370 --> 00:08:11,500
Ok this variable is dedicated for every instance that we create inside our main class.

119
00:08:11,500 --> 00:08:12,010
OK.

120
00:08:12,100 --> 00:08:19,210
So inside the main class in Lankton I decided to create an object from the slide in class and I named

121
00:08:19,270 --> 00:08:20,650
this object my lion.

122
00:08:20,660 --> 00:08:21,580
OK.

123
00:08:22,030 --> 00:08:29,260
And in line 14 I decided to output the value of this valuable through the console system that out that

124
00:08:29,270 --> 00:08:31,330
princeling my life and that speed.

125
00:08:31,360 --> 00:08:39,400
So here you are actually referring to the value of the copy of this variable.

126
00:08:39,520 --> 00:08:47,440
So for every instance that we create from this in class there is going to be another copy of these Spaeth

127
00:08:47,440 --> 00:08:50,140
variable for that specific object.

128
00:08:50,140 --> 00:08:50,900
OK.

129
00:08:51,100 --> 00:08:54,400
So if I for example want to create another object.

130
00:08:54,430 --> 00:08:59,800
First of all I just need to refer to the name of my class line the name of my object is.

131
00:08:59,800 --> 00:09:05,680
For example first line and then I put an assignment operator.

132
00:09:05,860 --> 00:09:12,940
And then I use the new key word here and then I refer to the name of my class and then I put a pair

133
00:09:12,940 --> 00:09:14,200
of round brackets here.

134
00:09:14,230 --> 00:09:17,910
And then at the end of my statement I need to put in a semi-colon OK.

135
00:09:18,340 --> 00:09:26,680
So now I just need to type in her system that out that print learn and then inside Apprentice's I just

136
00:09:26,680 --> 00:09:35,570
need to type in here ferde line that speed and then at the end of my statement I need to put in a semicolon.

137
00:09:35,650 --> 00:09:36,160
OK.

138
00:09:36,220 --> 00:09:40,040
So now if I run my project again this value is going to be 100.

139
00:09:40,060 --> 00:09:40,640
OK.

140
00:09:40,660 --> 00:09:41,300
Why.

141
00:09:41,440 --> 00:09:48,650
Because we are actually referring to the value of the copy of this variable.

142
00:09:48,910 --> 00:09:49,480
OK.

143
00:09:49,600 --> 00:09:56,410
So if you want to actually change the value of this Spizz valuable for this further like an object I

144
00:09:56,410 --> 00:10:01,540
just need to type in here first the line that speed is for example 20.

145
00:10:01,720 --> 00:10:02,430
OK.

146
00:10:02,680 --> 00:10:05,850
And then at the end of my statement I need to put in a semicolon.

