1
00:00:00,990 --> 00:00:04,930
So as you can see here my object is now created.

2
00:00:05,070 --> 00:00:09,400
So now I want to actually get the value of this instance valuable.

3
00:00:09,570 --> 00:00:11,370
My fourth dark object.

4
00:00:11,370 --> 00:00:14,600
So and then I had to actually output that value to the concert.

5
00:00:14,610 --> 00:00:20,610
So I just need to type in here a system that out does princeling.

6
00:00:21,020 --> 00:00:29,790
And then inside the prentices I referred to the name of my object my fourth dark thought get speed and

7
00:00:29,790 --> 00:00:33,530
then I need to put in a semi-colon at the end of my statement.

8
00:00:33,780 --> 00:00:40,680
So now if I run my project as you can see this is the value that is output to the console.

9
00:00:40,680 --> 00:00:41,230
OK.

10
00:00:41,400 --> 00:00:48,820
So this value as you can see here is the return value of this method here gets speed.

11
00:00:48,900 --> 00:00:56,850
OK the value of this split instance variable is 70 OK but inside take it speed Mefford are you multiplied

12
00:00:57,120 --> 00:00:58,570
that value by two.

13
00:00:58,770 --> 00:01:02,940
And then I assigned that value to spit instance variable.

14
00:01:02,940 --> 00:01:03,710
OK.

15
00:01:04,110 --> 00:01:07,850
And then in line 11 I returned that value OK.

16
00:01:07,890 --> 00:01:16,080
And as you can see here inside the console this is that value OK so 70 multiplied by two is one hundred

17
00:01:16,080 --> 00:01:16,680
and forty.

18
00:01:16,680 --> 00:01:19,580
This value is the returned value of the Smurfit.

19
00:01:19,590 --> 00:01:20,010
OK.

20
00:01:20,040 --> 00:01:26,670
So now let me actually show you another important point about these instance variables and these kids

21
00:01:26,690 --> 00:01:27,150
here my friend.

22
00:01:27,150 --> 00:01:27,680
OK.

23
00:01:27,780 --> 00:01:33,390
So first let me actually change the access modifier of this instance variable to public.

24
00:01:33,540 --> 00:01:39,740
And then inside the main method or you want to access the value of this instance variable directly.

25
00:01:39,740 --> 00:01:40,160
OK.

26
00:01:40,230 --> 00:01:48,120
So I just need to type in here system that out that princeling and then inside Apprentice's I just need

27
00:01:48,120 --> 00:01:56,430
to refer to the name of my object my fourth dog that speed and then I need to put in a semi-colon at

28
00:01:56,430 --> 00:01:58,160
the end of my statement.

29
00:01:58,170 --> 00:02:05,020
So now if I had on my project as you can see the value of this instance variable is actually changed.

30
00:02:05,120 --> 00:02:05,830
OK.

31
00:02:06,200 --> 00:02:12,310
That this value is the value of this instance variable of this my fourth dog object.

32
00:02:12,360 --> 00:02:20,700
OK you may ask that why this value is changed because inside get her my fed I multiplied that value

33
00:02:20,700 --> 00:02:24,410
by two and then I assign that value to this instance variable.

34
00:02:24,480 --> 00:02:28,050
So the value of this instance variable is now changed.

35
00:02:28,070 --> 00:02:28,580
OK.

36
00:02:28,710 --> 00:02:31,450
In line 11 I returned that value.

37
00:02:31,470 --> 00:02:32,060
OK.

38
00:02:32,070 --> 00:02:37,780
So that may actually change this to private.

39
00:02:37,860 --> 00:02:45,450
OK so now I want to actually create a set for my fed for my speed.

40
00:02:45,480 --> 00:02:46,590
Instance here.

41
00:02:46,710 --> 00:02:52,340
So again the access modifier of my set and my Fed is public.

42
00:02:53,290 --> 00:02:54,150
OK.

43
00:02:54,510 --> 00:03:01,690
And the return type of this method is Voyt and the name of this method is set speed.

44
00:03:02,180 --> 00:03:02,910
OK.

45
00:03:03,180 --> 00:03:05,930
And then I need to put in a pair of round brackets here.

46
00:03:06,330 --> 00:03:12,470
And inside the practices I want to specify that this method is going to accept an argument.

47
00:03:12,480 --> 00:03:13,200
OK.

48
00:03:13,440 --> 00:03:19,540
So the data type of my argument is it and the name of my argument is for example value.

49
00:03:19,560 --> 00:03:20,300
OK.

50
00:03:20,710 --> 00:03:26,160
And I want to open and close my method by using these curly braces so I insert the Smurfette.

51
00:03:26,190 --> 00:03:33,390
I can actually do some changes with the value of the argument and then I can set that value to my speed

52
00:03:33,390 --> 00:03:34,700
instance variable.

53
00:03:35,010 --> 00:03:36,540
So let's see how we can do that.

54
00:03:36,540 --> 00:03:44,100
First of all I need to refer to the name of my argument value and then I put an assignment operator

55
00:03:44,100 --> 00:03:44,780
here.

56
00:03:45,330 --> 00:03:55,820
And then again I refer to the name of my argument value plus five as you can see here I changed the

57
00:03:55,820 --> 00:04:03,230
value of the argument here and I added 5 values to the value of my argument.

58
00:04:03,230 --> 00:04:03,820
OK.

59
00:04:03,860 --> 00:04:07,870
And then I assigned that value to this argument.

60
00:04:07,940 --> 00:04:08,720
OK.

61
00:04:09,200 --> 00:04:17,450
So now I can actually refer to the name of my speed instance variable and then I put an assignment operator

62
00:04:17,450 --> 00:04:18,140
here.

63
00:04:18,570 --> 00:04:20,840
And then I refer to the name of my argument.

64
00:04:20,840 --> 00:04:28,310
So inside the main class here I want to actually set another value to that speed instance variable.

65
00:04:28,340 --> 00:04:35,240
So first of all I need to refer to the name of my object my fourth dog that set speed.

66
00:04:35,330 --> 00:04:38,240
So now I need to pass a value to this method.

67
00:04:38,390 --> 00:04:39,030
OK.

68
00:04:39,380 --> 00:04:42,230
So for example Number 10.

69
00:04:42,640 --> 00:04:43,650
OK.

70
00:04:44,120 --> 00:04:51,240
And now I want to actually output the value of this instance variable to the console.

71
00:04:51,410 --> 00:04:57,710
So I just need to type in here system that out that princeling.

72
00:04:58,470 --> 00:05:04,050
And then inside the prentices I need to refer to the name of my object and then I want to access the

73
00:05:04,050 --> 00:05:08,460
value of this instance variable by using that term of it.

74
00:05:08,540 --> 00:05:16,500
So I get speed and then I need to put a semicolon after my statement.

75
00:05:16,500 --> 00:05:23,050
So now if I get on my project as you can see this is the value that is output to the console.

76
00:05:23,160 --> 00:05:29,210
OK so now let me actually comment out this line of code here and let's run our project again.

77
00:05:29,400 --> 00:05:30,130
As you can see.

78
00:05:30,300 --> 00:05:34,610
So first of all the past number ten is set speed Meffert.

79
00:05:34,740 --> 00:05:36,580
OK so inside that class.

80
00:05:36,600 --> 00:05:43,680
So as you can see here inside this set speed method I specified that are you want to add five values

81
00:05:43,920 --> 00:05:45,680
to the value of the argument.

82
00:05:45,690 --> 00:05:46,090
OK.

83
00:05:46,110 --> 00:05:49,600
And then I assign that value to that argument.

84
00:05:49,740 --> 00:05:56,280
And then in line 15 I assign the value of that argument to that speed instance value.

85
00:05:56,280 --> 00:06:03,530
OK so now that I actually passed the number 10 to the Smurfette number 10 plus 5 is 15.

86
00:06:03,560 --> 00:06:07,910
OK so now the value of this instance variable is 15.

87
00:06:08,200 --> 00:06:18,150
OK but in line 48 inside the main class and inside the main method I decided to output that value to

88
00:06:18,150 --> 00:06:18,740
the console.

89
00:06:18,780 --> 00:06:25,950
So I deferred the name of my object and then I used this dot notation here and then I actually tried

90
00:06:26,040 --> 00:06:31,330
to access the value of this instance variable by using this good speed method.

91
00:06:31,350 --> 00:06:34,020
OK so now let's go inside the get speed method.

92
00:06:34,230 --> 00:06:37,210
So as you can see here this is our good speed method.

93
00:06:37,590 --> 00:06:41,770
So the value of the speed instance variable is 15.

94
00:06:41,870 --> 00:06:46,350
OK so 15 multiplied by 2 is 40.

95
00:06:46,350 --> 00:06:50,030
So the value of this instance variable is now 50.

96
00:06:50,250 --> 00:06:53,010
And then in line 11 I returned.

97
00:06:53,040 --> 00:06:54,020
That's right you.

98
00:06:54,150 --> 00:06:57,890
So the value of this instance variable is now 40.

99
00:06:58,140 --> 00:07:04,090
So as you can see here inside the console this is the value of our speed instance variable.

100
00:07:04,260 --> 00:07:04,750
OK.

101
00:07:04,800 --> 00:07:08,060
So I think that's enough for this tutorial.

102
00:07:08,310 --> 00:07:10,040
And in the next tutorial.

103
00:07:10,070 --> 00:07:17,390
And when I talk about class variables and how we can use the class methods in our Java codes.

104
00:07:17,430 --> 00:07:17,820
OK.

105
00:07:17,850 --> 00:07:19,570
So thank you very much for watching.

106
00:07:19,830 --> 00:07:25,350
And if you have any questions please post the discussion in the course and then I'll try my best to

107
00:07:25,350 --> 00:07:26,790
answer your questions.

