1
00:00:00,600 --> 00:00:09,060
So the value of a variable is fine as you can see I didn't assign a value to this valuable.

2
00:00:09,540 --> 00:00:16,780
When I created this valuable so this value comes from this value comes from this line of code here.

3
00:00:17,040 --> 00:00:26,080
OK here I assigned the value of the Zed's valuable to all of my valuables OK.

4
00:00:26,100 --> 00:00:36,600
As you can see so here in this line of code I specified that a assignment operator B assignment operator

5
00:00:36,730 --> 00:00:39,850
C and assignment operator is that.

6
00:00:39,930 --> 00:00:40,530
OK.

7
00:00:40,770 --> 00:00:47,560
So actually I assigned the value of this variable which is the that variable.

8
00:00:47,610 --> 00:00:54,290
Ok I assigned the value of this variable which is 5 to the variable.

9
00:00:54,420 --> 00:00:59,490
And then I assigned the value of this variable to the Beaverhead table here.

10
00:00:59,700 --> 00:01:04,620
And then I assigned the value of this variable to the a variable.

11
00:01:04,620 --> 00:01:05,100
OK.

12
00:01:05,190 --> 00:01:12,090
As you can see here and as you can see in the console the value of the variable is 5.

13
00:01:12,090 --> 00:01:14,970
The value of that be valuable is five.

14
00:01:14,970 --> 00:01:20,320
The value of the C variable is 5 and the value of this that Loughrea about is 5.

15
00:01:20,400 --> 00:01:20,900
OK.

16
00:01:21,090 --> 00:01:26,700
So you can actually assign values to your variables in this way that I showed you.

17
00:01:26,700 --> 00:01:27,070
OK.

18
00:01:27,090 --> 00:01:33,360
So as I said before assigning a value to a variable is an expression.

19
00:01:33,450 --> 00:01:33,920
OK.

20
00:01:34,080 --> 00:01:38,900
So here in this line of code for example we are assigning a value to this variable.

21
00:01:39,040 --> 00:01:39,520
OK.

22
00:01:39,540 --> 00:01:45,030
So this line of code is an expression OK because it produces a value.

23
00:01:45,060 --> 00:01:53,330
So the right side of an assignment expression always is calculated before the assignment takes place.

24
00:01:53,640 --> 00:01:58,290
So as you can see of it we actually assign a value to this variable.

25
00:01:58,320 --> 00:02:06,650
For example if I want to multiply this number by for this operation here is going to be evaluated first

26
00:02:06,990 --> 00:02:13,830
and then the result of this operation will be assigned to the value on the left hand side of the OPERATOR

27
00:02:13,950 --> 00:02:15,500
OK.

28
00:02:15,540 --> 00:02:20,030
So if I want to actually again I want food the value of this variable to the console.

29
00:02:20,100 --> 00:02:23,440
So as you can see the value of that variable is 20.

30
00:02:23,620 --> 00:02:32,160
Okay the right side of an assignment expression is always the right side of an assignment expression

31
00:02:32,520 --> 00:02:36,450
always is calculated before the assignment takes place.

32
00:02:36,480 --> 00:02:36,880
OK.

33
00:02:36,900 --> 00:02:44,010
So this operation here is going to be calculated first and then the value of this operation is going

34
00:02:44,010 --> 00:02:48,280
to be assigned to the value on the left hand side of the OPERATOR OK.

35
00:02:48,420 --> 00:02:51,240
So this is not an equal OPERATOR OK.

36
00:02:51,660 --> 00:02:54,120
This is an assignment operator.

37
00:02:54,120 --> 00:02:55,580
This is very important.

38
00:02:55,590 --> 00:02:56,720
OK.

39
00:02:56,790 --> 00:03:03,750
Using an expression to change of variables value is a common task in programming.

40
00:03:03,770 --> 00:03:04,320
OK.

41
00:03:04,350 --> 00:03:07,550
Several operators are used in these cases.

42
00:03:07,800 --> 00:03:14,850
So first let me actually comment out these lines of code here because I don't want to execute that.

43
00:03:14,870 --> 00:03:16,710
So now let me show you some examples.

44
00:03:16,730 --> 00:03:17,170
OK.

45
00:03:17,240 --> 00:03:20,140
For example I want to create two variables here.

46
00:03:20,150 --> 00:03:20,750
OK.

47
00:03:20,900 --> 00:03:26,870
So the data type of my variable is ain't and the name of my volumen is not one.

48
00:03:26,920 --> 00:03:27,490
OK.

49
00:03:27,680 --> 00:03:30,410
And then I assign a value to my variable.

50
00:03:30,410 --> 00:03:32,290
For example numbers 10 or J.

51
00:03:32,420 --> 00:03:37,040
And then at the end of my statement I need to put in a semi-colon OK.

52
00:03:37,610 --> 00:03:45,730
And here I want to create another variable in the name of my variable would be number two.

53
00:03:46,070 --> 00:03:48,650
And then I assign a value to my variable.

54
00:03:48,650 --> 00:03:50,120
For example number 8.

55
00:03:50,220 --> 00:03:50,700
OK.

56
00:03:50,780 --> 00:03:54,540
And then I need to add the semi-colon at the end of my value.

57
00:03:54,550 --> 00:04:00,440
OK so now I want to show you some operators in order to change of variables value.

58
00:04:00,470 --> 00:04:01,130
OK.

59
00:04:01,160 --> 00:04:07,030
And in the past we wanted to actually add a value to our variable.

60
00:04:07,130 --> 00:04:15,650
We would just refer to the name of our variable and then we put an assignment operator and then we referred

61
00:04:15,800 --> 00:04:17,170
to the name of our idea.

62
00:04:17,300 --> 00:04:20,820
And then we for example added a value to our value.

63
00:04:20,880 --> 00:04:27,990
OK so let me actually output the value of this variable with the concert system.

64
00:04:28,090 --> 00:04:35,780
Of that printin and then inside the parenthesis I just need to refer to the name of my variable here

65
00:04:36,320 --> 00:04:39,560
and at the end of my statement I need to put in a semi-colon.

66
00:04:39,570 --> 00:04:45,980
OK so if I run my project as you can see it's going to output this value for the console.

67
00:04:46,010 --> 00:04:46,930
OK.

68
00:04:47,300 --> 00:04:52,110
This value is the result of this operation that you can see here.

69
00:04:52,250 --> 00:04:52,730
OK.

70
00:04:52,820 --> 00:04:56,580
And here we assigned this value to our variable here.

71
00:04:56,600 --> 00:04:57,390
OK.

72
00:04:57,770 --> 00:05:01,290
Or I can actually add one value to my variable.

73
00:05:01,610 --> 00:05:07,410
And then if I run on my project as you can see it's going to output this value to the console.

74
00:05:07,630 --> 00:05:08,600
OK.

75
00:05:09,350 --> 00:05:15,810
So now let me show you another way of actually adding one value to our variable.

76
00:05:16,040 --> 00:05:16,510
OK.

77
00:05:16,580 --> 00:05:21,360
Again I need to refer to the name of my variable number one.

78
00:05:21,560 --> 00:05:27,180
And then I put the plus operator and the assignment operator OK.

79
00:05:27,620 --> 00:05:34,790
And then I just put in the number one here and at the end of my statement I need to add the semi-colon.

80
00:05:34,790 --> 00:05:36,230
OK.

81
00:05:36,230 --> 00:05:45,230
So if I actually output the value of this variable to the console Now system that out that insulin and

82
00:05:45,230 --> 00:05:52,250
then inside the prentices again I need to refer to the name of my variable and I need to actually add

83
00:05:52,310 --> 00:05:57,600
the semi-colon at the end of my statement in order to end this statement here.

84
00:05:57,830 --> 00:06:04,520
And if you run my project as you can see it's going to Outwood is going to output this value to the

85
00:06:04,520 --> 00:06:06,230
console like a number two.

86
00:06:06,450 --> 00:06:07,250
OK.

87
00:06:07,400 --> 00:06:16,220
So here in this line of code we added one value to our rowdier and so for example if we wanted to add

88
00:06:16,430 --> 00:06:21,470
free value to our free value free.

89
00:06:22,580 --> 00:06:25,610
So for example if I wanted to add free value.

90
00:06:25,940 --> 00:06:28,560
So for example.

91
00:06:29,210 --> 00:06:30,600
So for example.

92
00:06:30,800 --> 00:06:37,820
So for example if I wanted to add free to my valuable Let's see what happens let's let's run our project

93
00:06:37,850 --> 00:06:38,930
and see what happens.

94
00:06:38,930 --> 00:06:43,650
So as you can see it's going to add free value to the value of our value.

95
00:06:43,660 --> 00:06:44,250
OK.

96
00:06:44,570 --> 00:06:46,940
11 plus free is 14.

97
00:06:47,120 --> 00:06:47,540
OK.

98
00:06:47,540 --> 00:06:55,530
For example if I wanted to actually subtract some values from the value of this not too variable.

99
00:06:55,790 --> 00:06:58,430
I just need to type in here number two.

100
00:06:58,600 --> 00:06:59,200
Okay.

101
00:06:59,210 --> 00:07:07,570
And then I just need to put in minus and assignment operator here and here I need to actually put in

102
00:07:08,180 --> 00:07:12,540
there value that want to subtract from the value of this variable.

103
00:07:12,600 --> 00:07:14,510
Ok for example 5.

104
00:07:14,990 --> 00:07:18,940
And then at the end of my statement I need to put in a semi-colon OK.

105
00:07:19,190 --> 00:07:24,870
So I just need to type in here system that out that princeling.

106
00:07:25,840 --> 00:07:30,670
And then inside Apprentice's I just need to refer to the name of my value.

107
00:07:30,850 --> 00:07:35,260
And at the end of my statement I need to put in a semi-colon OK.

108
00:07:35,680 --> 00:07:40,990
So if I do it on my project as you can see it's going to output this value to the console.

109
00:07:41,030 --> 00:07:44,330
OK so 8 minus five is free.

110
00:07:44,580 --> 00:07:44,850
OK.

111
00:07:44,860 --> 00:07:54,790
As you can see here so as you can see here this statement here is the same as this statement.

112
00:07:54,830 --> 00:07:55,580
OK.

113
00:07:55,620 --> 00:08:01,760
Now one and then we put the assignment operator and then if you put the name of our variable plus number

114
00:08:01,760 --> 00:08:02,150
one.

115
00:08:02,240 --> 00:08:03,190
OK.

116
00:08:03,710 --> 00:08:09,500
And again this statement here is the same as this statement.

117
00:08:10,100 --> 00:08:15,570
And this one again is the same as this statement OK.

118
00:08:16,170 --> 00:08:20,900
And this statement is the same as this statement.

119
00:08:21,300 --> 00:08:25,890
And this statement is the same as this statements.

120
00:08:25,890 --> 00:08:26,660
OK.

121
00:08:27,210 --> 00:08:31,830
So this way of actually writing your statements is a lot of advice.

122
00:08:31,860 --> 00:08:32,340
OK.

123
00:08:32,400 --> 00:08:36,120
So you can actually assign values to your variables this way.

124
00:08:36,320 --> 00:08:36,780
OK.

125
00:08:36,960 --> 00:08:43,580
But are wanted to show you how you can actually assign values to your variables in this way.

126
00:08:43,710 --> 00:08:51,700
So maybe in the future you may see in some other source codes the program may have actually used this

127
00:08:51,710 --> 00:08:57,570
way of assigning values to the ballots in his or her Java programs.

128
00:08:57,610 --> 00:09:02,300
OK this is just another way of assigning values to your valuables.

129
00:09:02,310 --> 00:09:02,760
OK.

130
00:09:02,760 --> 00:09:10,080
So another important point that I want to show you here is that for example if I want to declare another

131
00:09:10,080 --> 00:09:10,990
variable here.

132
00:09:11,090 --> 00:09:13,600
Ain't no free.

133
00:09:14,250 --> 00:09:16,460
And then I assign a value to my value.

134
00:09:16,490 --> 00:09:17,250
OK.

135
00:09:17,580 --> 00:09:25,010
So here if you want to add value to my variable i just need to type in here now free plus.

136
00:09:25,050 --> 00:09:26,950
And then the assignment operator.

137
00:09:27,180 --> 00:09:30,120
And then I just need to put in a value here.

138
00:09:30,120 --> 00:09:31,610
For example number four.

139
00:09:31,790 --> 00:09:32,220
OK.

140
00:09:32,220 --> 00:09:35,400
At the end of my statement I need to put in a semi-colon.

141
00:09:35,730 --> 00:09:41,520
So if I actually want to output the value of this variable to the console I just need to type in your

142
00:09:41,520 --> 00:09:49,390
system with out that insulin and then inside the prentices I need to refer to the name of my variable.

143
00:09:49,610 --> 00:09:50,300
Now free.

144
00:09:50,390 --> 00:09:54,230
And then at the end of my statement I need to add the semi-colon OK.

