1
00:00:00,520 --> 00:00:06,250
Really well and then I use a plus operator and then I refer to the name the name of your body.

2
00:00:06,260 --> 00:00:13,170
But for example number here and that again I can use a plus operator in order to concatenate these values

3
00:00:13,320 --> 00:00:19,060
to other values for example again I use double quotes and inside the double code.

4
00:00:19,110 --> 00:00:22,060
I just use actually space here.

5
00:00:22,500 --> 00:00:24,600
And then I can enter my text.

6
00:00:24,600 --> 00:00:32,320
For example this is my variable and this is great.

7
00:00:32,380 --> 00:00:37,360
This is great for programming.

8
00:00:37,370 --> 00:00:46,090
So now if I actually press on the Enter key on my keyboard Let's see what happens.

9
00:00:46,670 --> 00:00:47,260
OK.

10
00:00:47,360 --> 00:00:48,760
Just press ENTER key.

11
00:00:48,890 --> 00:00:56,660
So as you can see it automatically puts up plus operator and two double codes in order to help me continue

12
00:00:56,660 --> 00:00:57,900
adding other values.

13
00:00:57,920 --> 00:00:58,460
OK.

14
00:00:58,550 --> 00:01:06,640
For example here inside these double quotes I can put another value for example other values.

15
00:01:06,740 --> 00:01:07,480
OK.

16
00:01:07,820 --> 00:01:12,680
And then at the end I just need to put a semicolon into my statement.

17
00:01:12,710 --> 00:01:17,480
So now actually let's run our project and see what happens.

18
00:01:17,480 --> 00:01:23,620
So as you can see it now it has output had these values to their console area.

19
00:01:23,690 --> 00:01:24,430
OK.

20
00:01:24,860 --> 00:01:27,090
So I think that's enough for concatenation.

21
00:01:27,140 --> 00:01:27,700
OK.

22
00:01:27,800 --> 00:01:32,890
Now I want to output the value of this and other number variable to the console.

23
00:01:32,980 --> 00:01:33,850
OK.

24
00:01:34,100 --> 00:01:40,160
So first let me point out that I don't want to execute these other statements here.

25
00:01:40,160 --> 00:01:43,630
So I just need to actually comment out these lines of code.

26
00:01:43,940 --> 00:01:44,350
OK.

27
00:01:44,360 --> 00:01:53,520
As you can see here so now as you can see I want to output the value of this variable to the concert

28
00:01:54,390 --> 00:02:00,010
and you can see that I didn't assign a value to my variable here.

29
00:02:00,030 --> 00:02:06,900
So now let's just output the value of this and other number but as you can see here to the console.

30
00:02:06,930 --> 00:02:07,550
OK.

31
00:02:07,830 --> 00:02:13,000
So we need to type in a system that's out that princeling.

32
00:02:13,680 --> 00:02:18,660
And that inside the apprentice's just referred to the name of that variable.

33
00:02:18,700 --> 00:02:22,250
OK the number okay.

34
00:02:22,520 --> 00:02:27,430
And then we need to put a semicolon at the end of our statement.

35
00:02:27,560 --> 00:02:31,950
So as you can see here it's now showing us a nasty error.

36
00:02:32,090 --> 00:02:34,290
So let's see what's this error.

37
00:02:34,700 --> 00:02:37,630
As you can see here it says the local variable.

38
00:02:37,630 --> 00:02:40,860
Another number may not have been initialized.

39
00:02:40,940 --> 00:02:46,900
I talked more about local variables later in this section but for now just ignore it.

40
00:02:47,090 --> 00:02:52,880
And as you can see here it's now telling us that this another number of about does not have a value.

41
00:02:52,940 --> 00:02:59,550
OK we didn't assign a value to this variable when we created this variable.

42
00:02:59,750 --> 00:03:05,250
So now if I for example assign a value numbers 10 to this variable.

43
00:03:05,260 --> 00:03:07,340
Now as you can see the error is gone.

44
00:03:07,370 --> 00:03:09,680
Now I can run my project.

45
00:03:09,680 --> 00:03:10,880
So this is number 10.

46
00:03:10,950 --> 00:03:15,550
OK this is the value of this and other numbers here.

47
00:03:15,620 --> 00:03:21,950
So it's a very good programming practice that you assign a value to your valuables when you create them.

48
00:03:22,160 --> 00:03:22,840
OK.

49
00:03:23,210 --> 00:03:27,770
But let me point out another important point here.

50
00:03:27,770 --> 00:03:34,060
For example if I actually assign a value value to my variable and now is showing us an error.

51
00:03:34,070 --> 00:03:34,490
OK.

52
00:03:34,550 --> 00:03:41,050
So if I hover over the error it's now recommending us that we should initialize the variable.

53
00:03:41,060 --> 00:03:41,600
OK.

54
00:03:41,750 --> 00:03:44,460
So if I click on this initialize Maribelle.

55
00:03:45,020 --> 00:03:49,600
Now as you can see it automatically assigned a value to my body.

56
00:03:49,760 --> 00:03:51,120
Now the error is gone.

57
00:03:51,260 --> 00:03:55,780
And when I run my project the value of my variable is showing here.

58
00:03:55,820 --> 00:03:56,320
OK.

59
00:03:56,440 --> 00:03:57,090
OK.

60
00:03:57,230 --> 00:04:01,810
Now I'm going to you about declaring variables in another way.

61
00:04:01,910 --> 00:04:02,470
OK.

62
00:04:02,630 --> 00:04:06,320
So first let me comment out these lines of code.

63
00:04:06,700 --> 00:04:07,160
OK.

64
00:04:07,190 --> 00:04:09,020
Because I don't want to execute them.

65
00:04:09,290 --> 00:04:17,840
So first let me actually point out when you are creating several variables of the same type you can

66
00:04:17,840 --> 00:04:24,320
declare all of them in the same statement by separating the variable names with commas.

67
00:04:24,370 --> 00:04:27,360
OK so what do you mean by that.

68
00:04:27,410 --> 00:04:31,740
First let me assure you that I will not declare three different variables here.

69
00:04:31,780 --> 00:04:36,430
OK the first one would be it is data type is it.

70
00:04:36,440 --> 00:04:37,390
As you can see here.

71
00:04:37,640 --> 00:04:39,870
And the name of my variable is number one.

72
00:04:39,980 --> 00:04:48,570
OK the second one will be in again and its name will be known to the first one with the end and the

73
00:04:48,580 --> 00:04:50,040
it's name would be number three.

74
00:04:50,090 --> 00:04:50,780
OK.

75
00:04:50,780 --> 00:04:57,020
So as you can see here I've got three different variables but it's the same as you can see with the

76
00:04:57,020 --> 00:04:57,990
same data.

77
00:04:58,010 --> 00:04:58,520
OK.

78
00:04:58,670 --> 00:05:04,970
Three different variables with three different names but these three variables have got the same data

79
00:05:05,030 --> 00:05:06,400
type which is in here.

80
00:05:06,440 --> 00:05:06,950
OK.

81
00:05:07,220 --> 00:05:12,040
So now I want to show you how you can declare these variables in an other way.

82
00:05:12,170 --> 00:05:12,570
OK.

83
00:05:12,710 --> 00:05:17,280
So first let me actually comment about these three variables here.

84
00:05:17,510 --> 00:05:18,650
As you can see here.

85
00:05:18,830 --> 00:05:25,010
So now I want to show you another way to actually declare this for the variables the data type as you

86
00:05:25,010 --> 00:05:26,230
can see here is it.

87
00:05:26,270 --> 00:05:31,030
OK so now the name of the first variable is number one.

88
00:05:31,130 --> 00:05:32,660
So now I'm typing here now what.

89
00:05:32,670 --> 00:05:34,500
It's a comma.

90
00:05:34,940 --> 00:05:37,890
The name of the second variable is number two.

91
00:05:38,180 --> 00:05:41,290
Ok now I'm typing here not to.

92
00:05:41,320 --> 00:05:41,850
OK.

93
00:05:41,930 --> 00:05:42,620
After the comma.

94
00:05:42,620 --> 00:05:43,730
Just type in two.

95
00:05:43,820 --> 00:05:50,310
OK the name of this first actually the name of the first variable is now three.

96
00:05:50,390 --> 00:05:53,350
So I just type here number three.

97
00:05:53,720 --> 00:05:59,280
So as you can see here I declared these free variables in one statement here.

98
00:05:59,400 --> 00:06:03,980
OK these are these are three different variables with the same.

99
00:06:04,190 --> 00:06:11,970
Actually data type and also make sure that you put the semi-colon at the end of your statement here.

100
00:06:12,020 --> 00:06:14,300
OK this is very important.

101
00:06:14,360 --> 00:06:19,290
So now you may ask that can I actually assign values to these variables here.

102
00:06:19,340 --> 00:06:19,990
Yes you can.

103
00:06:20,000 --> 00:06:23,940
For example I can assign a value to this.

104
00:06:23,960 --> 00:06:25,460
Now one variable here.

105
00:06:25,550 --> 00:06:26,040
OK.

106
00:06:26,180 --> 00:06:29,060
So first I need an assignment operator.

107
00:06:29,090 --> 00:06:36,790
As I said before and that I need a value to actually assign that value to this variable so the value

108
00:06:36,810 --> 00:06:37,220
would be.

109
00:06:37,220 --> 00:06:38,820
For example number 50.

110
00:06:38,930 --> 00:06:39,740
OK.

111
00:06:39,740 --> 00:06:45,770
Now as you can see here I assigned the value of 50 on the right hand side of the operator to the left

112
00:06:45,770 --> 00:06:47,050
hand side of the operator.

113
00:06:47,100 --> 00:06:48,930
And now you may ask that.

114
00:06:48,970 --> 00:06:53,380
Can I actually output the value of this variable to the console.

115
00:06:53,510 --> 00:06:54,430
Yes you can.

116
00:06:54,610 --> 00:07:02,750
You can actually just type in here a system that out that print line and inside the parenthesis you

117
00:07:02,750 --> 00:07:06,450
just need to refer to the name of that specific value.

118
00:07:06,490 --> 00:07:10,780
OK so now I want to read the value of this valuable here.

119
00:07:10,910 --> 00:07:14,840
So I just need to refer to the name of that variable which is number 1.

120
00:07:14,870 --> 00:07:15,390
OK.

121
00:07:15,530 --> 00:07:18,930
And at the end I need to put the semicolon here.

122
00:07:19,120 --> 00:07:19,680
OK.

123
00:07:20,010 --> 00:07:25,830
So now if I run my project as you can see it's going to output the value of 50 to the console.

124
00:07:25,890 --> 00:07:31,750
And here if I want to for example refer to the name of the valuable number two.

125
00:07:31,980 --> 00:07:38,820
Let's see what happens system that out that Queensland land and inside the prentices.

126
00:07:39,090 --> 00:07:43,910
I just need to refer to the name of this variable in order to read its value.

127
00:07:44,030 --> 00:07:44,590
OK.

128
00:07:44,790 --> 00:07:50,940
So if I just typed in here number two and at the end I just need to put a semicolon here at the end

129
00:07:50,940 --> 00:07:52,600
of my statement.

130
00:07:52,650 --> 00:07:58,530
So as you can see here it's going to show me an error again because I didn't assign a value to this

131
00:07:58,530 --> 00:07:59,470
variable here.

132
00:07:59,540 --> 00:08:00,390
OK.

133
00:08:00,420 --> 00:08:06,850
So now if I actually assign a value for example number 20 to this variable.

134
00:08:06,900 --> 00:08:10,230
The error is gone and I can run my project now.

135
00:08:10,470 --> 00:08:16,360
And now I want to output the value of this number three valuable to the console.

136
00:08:16,440 --> 00:08:22,260
OK so now let me show you how you can do that because you want to actually explain another important

137
00:08:22,260 --> 00:08:26,110
point about assigning values to variables.

138
00:08:26,240 --> 00:08:32,080
OK now I'm going to output the value of is now free variable to the cost.

139
00:08:32,100 --> 00:08:32,800
OK.

140
00:08:33,030 --> 00:08:42,210
So first I need to type in System system that out that print alone and inside Apprentice's.

141
00:08:42,450 --> 00:08:45,830
I just need to refer to this now everywhere.

142
00:08:45,870 --> 00:08:46,450
OK.

143
00:08:46,860 --> 00:08:48,360
Now I'm free.

144
00:08:48,570 --> 00:08:52,840
And then at the end of my statement I just say to put in our semicolon.

145
00:08:52,920 --> 00:08:53,660
OK.

146
00:08:54,120 --> 00:09:00,630
So now as you can see it's now showing me an error again because I didn't assign a value to this variable

147
00:09:00,630 --> 00:09:02,150
when I created this variable.

148
00:09:02,160 --> 00:09:02,740
OK.

149
00:09:02,880 --> 00:09:09,840
So now I want to show you how you can actually assign a value in our variable after creation of that

150
00:09:09,840 --> 00:09:10,560
variable.

151
00:09:10,710 --> 00:09:15,990
So now as you can see I'm going to refer to the name of this variable not.

152
00:09:16,110 --> 00:09:16,780
OK.

153
00:09:16,980 --> 00:09:20,520
And then I just put in us an assignment operator.

154
00:09:20,970 --> 00:09:26,650
And then I just assign a value to my variable for example number 50 55.

155
00:09:26,760 --> 00:09:27,510
OK.

156
00:09:27,990 --> 00:09:30,380
So as you can see the error is now gone.

157
00:09:30,570 --> 00:09:31,050
OK.

158
00:09:31,230 --> 00:09:38,440
So now if I run my project as you can see here it's going to Outwood this value of 35 to the concert.

159
00:09:38,460 --> 00:09:46,000
OK so first let me actually comment out these two lines of code and again I just need to run my project

160
00:09:46,030 --> 00:09:47,090
as you can see here.

161
00:09:47,200 --> 00:09:51,110
It's going to outfalls the value of 35 to the concert.

162
00:09:51,130 --> 00:09:53,320
This value is the value of this.

163
00:09:53,320 --> 00:09:54,260
Now everybody about.

