1
00:00:00,240 --> 00:00:09,130
LUGG that are an orgy Come on now I want to actually refer to the name of this are eastern values OK

2
00:00:09,210 --> 00:00:10,120
brackets.

3
00:00:10,230 --> 00:00:14,850
Now we want to actually for the index number free inside of these.

4
00:00:14,880 --> 00:00:17,340
Ari this index is number 0.

5
00:00:17,340 --> 00:00:24,210
This index is number one and this index is number two and we don't have any index that could be called

6
00:00:24,420 --> 00:00:26,620
index number four here.

7
00:00:26,640 --> 00:00:28,080
This is index number 0.

8
00:00:28,080 --> 00:00:29,470
This is index number one.

9
00:00:29,490 --> 00:00:31,440
And this is indexed number two.

10
00:00:31,470 --> 00:00:37,980
But here in this line of code in line 40 we are actually feeling the index number free which doesn't

11
00:00:38,010 --> 00:00:39,640
exist in this array.

12
00:00:39,690 --> 00:00:42,270
So let's actually go on our project and see what happens.

13
00:00:42,390 --> 00:00:49,720
So as you can see here our application actually crashed and it says unfortunately ABBOTT Well has stopped.

14
00:00:49,880 --> 00:00:50,640
OK.

15
00:00:51,180 --> 00:00:52,460
So what's going on here.

16
00:00:52,560 --> 00:01:00,370
Because we actually deferred to our value OK to an index of this area that actually doesn't exist.

17
00:01:00,390 --> 00:01:06,840
That's why our Actually our application crashed and we cannot refer to an index of an array which doesn't

18
00:01:06,840 --> 00:01:07,450
exist.

19
00:01:07,490 --> 00:01:10,310
Index Number Three doesn't exist in this array.

20
00:01:10,320 --> 00:01:12,440
This is number index number 0.

21
00:01:12,450 --> 00:01:13,640
This is index number one.

22
00:01:13,680 --> 00:01:15,730
And this is index number two.

23
00:01:15,860 --> 00:01:16,480
OK.

24
00:01:16,620 --> 00:01:19,250
We don't have index number free in this area.

25
00:01:19,320 --> 00:01:22,550
It is true that these are the size of this array is free.

26
00:01:22,590 --> 00:01:27,930
But remember programming especially in arrays we count from number zero.

27
00:01:28,040 --> 00:01:28,530
OK.

28
00:01:28,540 --> 00:01:30,780
Number 0 1 2.

29
00:01:30,990 --> 00:01:36,680
We don't have number three here so we cannot refer to that index number free here.

30
00:01:36,690 --> 00:01:37,680
So this is wrong.

31
00:01:37,860 --> 00:01:44,390
We can actually only refer to index number 0 or index number one or index number two.

32
00:01:44,430 --> 00:01:47,730
So let's actually run our project and see what happens.

33
00:01:47,730 --> 00:01:52,140
So as you can see here our application is actually running on the emulator.

34
00:01:52,350 --> 00:01:56,060
And fortunately our application didn't crash this time.

35
00:01:56,100 --> 00:02:00,770
So as you can see here inside that lock now we can see disvalue table here.

36
00:02:00,810 --> 00:02:01,530
OK.

37
00:02:01,860 --> 00:02:07,320
So here you specified that are string values index number 2.

38
00:02:07,590 --> 00:02:11,660
So it can actually return this value table here.

39
00:02:11,670 --> 00:02:11,930
OK.

40
00:02:11,940 --> 00:02:14,640
It's going to start out with this value to that to the lock.

41
00:02:14,640 --> 00:02:16,200
So hopefully that makes sense.

42
00:02:16,230 --> 00:02:23,070
And let's actually comment out these lines of code here and here we can actually output some values

43
00:02:23,580 --> 00:02:30,540
to the screen and we don't need these lines of code here anymore so I just commented out them.

44
00:02:30,540 --> 00:02:32,670
Now let's actually start coding here.

45
00:02:32,700 --> 00:02:33,320
OK.

46
00:02:33,570 --> 00:02:34,520
OK everyone.

47
00:02:34,530 --> 00:02:43,840
Now let's actually create some objects from the text your class takes you to the index or key assignment

48
00:02:43,860 --> 00:02:44,680
operator.

49
00:02:44,850 --> 00:02:50,820
And here we need to actually cast this object to I talk text view object find view by ID are thought

50
00:02:50,940 --> 00:02:54,450
Id DOT takes the index.

51
00:02:54,450 --> 00:02:55,080
OK.

52
00:02:55,590 --> 00:03:03,390
Let's actually create another text view object X the value assignment operator takes a view find view

53
00:03:03,390 --> 00:03:09,000
by id r that Id DOT takes the value.

54
00:03:09,000 --> 00:03:13,010
OK so now let's actually create two string variables.

55
00:03:13,110 --> 00:03:14,160
Strange.

56
00:03:15,530 --> 00:03:22,890
And the name of our idea is all the index value.

57
00:03:23,690 --> 00:03:24,540
OK.

58
00:03:24,590 --> 00:03:27,300
Again let's actually create another string variable.

59
00:03:27,600 --> 00:03:32,620
Old the value.

60
00:03:33,030 --> 00:03:34,260
Value.

61
00:03:34,860 --> 00:03:35,430
OK.

62
00:03:35,670 --> 00:03:40,800
So as you can see here I didn't instantiate these string variables.

63
00:03:40,800 --> 00:03:47,460
So by default these are variables are going to actually fail to a null object inside the memory.

64
00:03:47,480 --> 00:03:51,540
OK because we didn't assign any value to these string variables.

65
00:03:51,570 --> 00:03:53,970
And because our string is actually a class.

66
00:03:54,180 --> 00:03:58,100
So if you are actually Fehring to an object inside the memory.

67
00:03:58,110 --> 00:04:04,020
So here this object actually refers to a null object inside the memory key because we didn't assign

68
00:04:04,020 --> 00:04:07,020
any value to this string object.

69
00:04:07,320 --> 00:04:11,380
So here let's actually create an array of integer numbers in it.

70
00:04:11,550 --> 00:04:16,790
And here let's actually putting a pair of brackets after our type of data type.

71
00:04:16,830 --> 00:04:20,810
We need to actually put in a pair of brackets because we want to actually create an array.

72
00:04:20,820 --> 00:04:23,940
And here let's actually give a name to what are they.

73
00:04:23,940 --> 00:04:26,030
For example int array.

74
00:04:26,070 --> 00:04:26,480
OK.

75
00:04:26,530 --> 00:04:34,290
Assignment operator and here I want to actually create an array by using the new operator here int and

76
00:04:34,290 --> 00:04:35,830
here inside the brackets.

77
00:04:35,910 --> 00:04:38,570
I need to actually specify the size of my array.

78
00:04:38,600 --> 00:04:45,080
Ok so my ARA is going to actually accept 10 values of type integer.

79
00:04:45,140 --> 00:04:50,130
OK so now let's actually create a for loop and here inside the prentices.

80
00:04:50,130 --> 00:04:54,060
Let's actually create an integer variable into counter.

81
00:04:54,640 --> 00:04:55,180
OK.

82
00:04:55,410 --> 00:05:02,220
Assignment operator zero counter less than int array.

83
00:05:02,840 --> 00:05:04,270
That's Len.

84
00:05:04,810 --> 00:05:05,410
OK.

85
00:05:05,650 --> 00:05:08,990
Trantor plus plus.

86
00:05:09,760 --> 00:05:16,980
OK so now as you can see first we created an integer variable called counter and we assigned numbers

87
00:05:16,980 --> 00:05:18,690
zero to this counter.

88
00:05:18,700 --> 00:05:21,010
And here we are actually creating a condition.

89
00:05:21,010 --> 00:05:28,420
And here we are saying that until the counter is less than the value of the length of this array.

90
00:05:28,570 --> 00:05:29,200
OK.

91
00:05:29,530 --> 00:05:33,060
So the length of this area is 10 until this value.

92
00:05:33,060 --> 00:05:36,380
These are the value of this counter is less than number 10.

93
00:05:36,400 --> 00:05:36,770
OK.

94
00:05:36,820 --> 00:05:41,520
0 1 2 3 4 5 6 7 8 9.

95
00:05:41,950 --> 00:05:49,090
So until it reaches number 9 it is going to actually execute this loop and after it reaches number two

96
00:05:49,100 --> 00:05:54,880
and the value of this counter is 10 it's going to actually skip this loop here and then it's going to

97
00:05:54,880 --> 00:05:58,600
actually execute are lines of code after this loop here.

98
00:05:58,600 --> 00:05:59,020
OK.

99
00:05:59,050 --> 00:06:05,110
So here we are saying that increment the value of this counter variable Bhagavan every time this loop

100
00:06:05,140 --> 00:06:06,400
is executed OK.

101
00:06:06,520 --> 00:06:10,810
So now inside the loop I can actually put in some more lines of code.

102
00:06:10,990 --> 00:06:13,970
So first of all it's actually a instantiate.

103
00:06:13,990 --> 00:06:24,500
This all takes the index value assignment operator ticks the index dot get text that string.

104
00:06:24,750 --> 00:06:25,250
OK.

105
00:06:25,480 --> 00:06:29,690
Here we are actually getting the value of the CTX the index takes you.

106
00:06:29,710 --> 00:06:30,500
So this is.

107
00:06:30,790 --> 00:06:34,250
So here let's actually click on this clear cache here.

108
00:06:34,450 --> 00:06:38,100
So this is the value of these RTX the index.

109
00:06:38,190 --> 00:06:38,580
OK.

110
00:06:38,680 --> 00:06:41,760
This is TSTO the stakes for you as you can see here.

111
00:06:42,100 --> 00:06:44,040
And this is the X the value takes.

112
00:06:44,050 --> 00:06:44,700
OK.

113
00:06:44,920 --> 00:06:47,960
And here is our line of code as you can see inside the loop.

114
00:06:47,980 --> 00:06:49,970
I am getting the value of those takes.

115
00:06:50,030 --> 00:06:50,420
OK.

116
00:06:50,440 --> 00:06:55,050
And I am putting that value inside this all the x the index value.

117
00:06:55,330 --> 00:07:01,660
And let's actually instantiate this or Tillich's the value of value assignment operator TXI the value

118
00:07:02,470 --> 00:07:06,330
that get text dot to a string.

119
00:07:06,670 --> 00:07:07,390
OK.

120
00:07:07,420 --> 00:07:14,560
And here I am actually getting the value of that RTX the value here and I am actually converting that

121
00:07:14,560 --> 00:07:15,970
value to a string value.

122
00:07:16,150 --> 00:07:21,330
And here I am actually assigning value to these all the value value OK.

123
00:07:21,430 --> 00:07:27,560
So now here it's actually putting some values to these in the index text view.

124
00:07:27,580 --> 00:07:30,910
And these takes the value takes view.

125
00:07:30,910 --> 00:07:36,620
So here I can just I've been to the index dot set text here.

126
00:07:37,030 --> 00:07:47,000
And then inside the parenthesis I can just type in all it takes the index value OK plus counter.

127
00:07:47,110 --> 00:07:47,590
OK.

128
00:07:47,710 --> 00:07:51,080
Plus two double quotes and inserted double quotes.

129
00:07:51,100 --> 00:07:53,900
I can just put in a new line character OK.

130
00:07:53,980 --> 00:08:01,460
So back for Slash and I am actually putting the all the value of the index takes view plus counter.

131
00:08:01,570 --> 00:08:02,640
OK.

132
00:08:02,660 --> 00:08:04,910
And I am actually putting the counter here.

133
00:08:04,930 --> 00:08:10,780
The value of this counter like Index and here I am actually creating a newline character OK.

134
00:08:10,930 --> 00:08:15,590
So after each execution of this loop is going to actually create a newline character and then it's going

135
00:08:15,590 --> 00:08:19,210
to put values below each other.

136
00:08:19,210 --> 00:08:23,720
So let's actually 5:47 the value that said text.

137
00:08:24,040 --> 00:08:28,230
All takes the value value plus.

138
00:08:28,320 --> 00:08:28,530
OK.

139
00:08:28,540 --> 00:08:35,580
And this time I want to actually output the value that is inside of this area here and that is.

140
00:08:35,730 --> 00:08:39,920
And that value is related to that specific index that specific counter.

141
00:08:40,120 --> 00:08:44,830
So here I again just refer to the name of this int array here.

142
00:08:45,070 --> 00:08:52,360
I need to actually put in a pair of brackets and I want the value that is inside of that counter.

143
00:08:52,390 --> 00:08:52,820
OK.

144
00:08:52,870 --> 00:09:00,070
And here I need to actually put in a plus operator and two double quotes here and a new line character.

145
00:09:00,070 --> 00:09:04,780
So here as you can see I am referring to the name of this order takes the value of value valuable as

146
00:09:04,780 --> 00:09:05,920
you can see here.

147
00:09:05,980 --> 00:09:08,840
This idea has that value.

148
00:09:08,870 --> 00:09:15,430
This has the value that is inside the text the value takes you plus and I put a plus operator here in

149
00:09:15,430 --> 00:09:18,370
order to concatenate this value with other values.

150
00:09:18,580 --> 00:09:24,400
So here we are actually referring to the name of this area 8 into the sub counter.

151
00:09:24,490 --> 00:09:25,070
OK.

152
00:09:25,090 --> 00:09:30,520
So it's going to actually give me the value that is inside of that specific counter.

153
00:09:30,520 --> 00:09:31,480
Ok for example.

154
00:09:31,570 --> 00:09:36,310
So the first time this loop is going to be executed or the value of this counter is zero.

155
00:09:36,310 --> 00:09:36,800
OK.

156
00:09:36,820 --> 00:09:39,010
And it's going to actually check this condition.

157
00:09:39,030 --> 00:09:41,930
So sort Chouteau is less than an hour late that lent.

158
00:09:41,980 --> 00:09:44,340
So it is true zero is a little less than 10.

159
00:09:44,530 --> 00:09:46,530
And then it's going to go inside the loop.

160
00:09:46,570 --> 00:09:52,300
And then after executing these two lines of code here after assigning these values to these valuable

161
00:09:52,340 --> 00:09:58,210
it's going actually execute these lines of coheres can actually output this value discounted value to

162
00:09:58,210 --> 00:10:02,500
their screen or to the index value plus counter.

163
00:10:02,770 --> 00:10:09,690
OK so the counter is this right your number zero and then I actually create a newline character and

164
00:10:09,690 --> 00:10:16,710
then it's going to output this value to the screen or all takes the value value OK plus it Eric Cantor

165
00:10:16,710 --> 00:10:18,100
counter is 0.

166
00:10:18,120 --> 00:10:24,740
So the value of that is inside of the counter zero is for example and not Baraki is going to outputs

167
00:10:24,750 --> 00:10:25,810
that value to the screen.

168
00:10:25,830 --> 00:10:29,100
So let's actually it on our project and see the results.

169
00:10:29,100 --> 00:10:33,810
So as you can see here now our application is actually running on this emulator here.

170
00:10:33,810 --> 00:10:34,410
Okay.

171
00:10:34,860 --> 00:10:40,770
And here on the left hand side we can see the indexes and on the right hand side we can see the values

172
00:10:40,830 --> 00:10:42,780
that are actually related to these indexes.

173
00:10:42,780 --> 00:10:43,150
Okay.

174
00:10:43,230 --> 00:10:49,740
So because we didn't assign any value to the indexes of this array that the values that are actually

175
00:10:49,740 --> 00:10:52,020
related to these indexes are zero.

176
00:10:52,020 --> 00:10:54,160
The default value is zero.

177
00:10:54,290 --> 00:11:00,510
OK for the indexes of the rate that we actually create here we just specify that this array is going

178
00:11:00,510 --> 00:11:07,900
to have 10 places 10 empty places for the values that we can specify to those places.

179
00:11:07,890 --> 00:11:08,420
Okay.

180
00:11:08,760 --> 00:11:15,960
And for example a place that is actually the index 0 means the place number 0 has the value zero.

181
00:11:15,960 --> 00:11:21,190
So this is the default value the place number one has the value 0 and so on.

182
00:11:21,510 --> 00:11:28,070
So now it's actually here after creating or out a let's actually assign a value to one of those indexes

183
00:11:28,080 --> 00:11:33,120
for example int array and then here we can actually put in a pair of brackets.

184
00:11:33,330 --> 00:11:38,170
And for example I can I want to I want to actually assign a value to the index number five.

185
00:11:38,360 --> 00:11:38,850
OK.

186
00:11:38,940 --> 00:11:42,930
And now I can actually assign an integer value to this index.

187
00:11:42,930 --> 00:11:47,870
For example number 27 and this actually is on our project and see what happens.

188
00:11:47,940 --> 00:11:48,920
OK everyone.

189
00:11:48,990 --> 00:11:55,170
Now as you can see here we can see the value that is actually related to this index.

190
00:11:55,400 --> 00:11:55,850
OK.

191
00:11:55,920 --> 00:11:57,960
So hopefully that makes sense.

192
00:11:58,380 --> 00:12:01,210
And I think that's enough for this tutorial.

193
00:12:01,230 --> 00:12:05,320
Make sure that you actually create this application over and over.

194
00:12:05,370 --> 00:12:12,330
So that are creating alleys in Java because a second nature arrays are very important so you need to

195
00:12:12,330 --> 00:12:16,930
know how to work with arrays in order to create great and great applications.

196
00:12:16,930 --> 00:12:17,320
OK.

197
00:12:17,340 --> 00:12:18,470
So this is really important.

198
00:12:18,480 --> 00:12:22,140
And this section of the course I think is the most important section of the course.

199
00:12:22,230 --> 00:12:23,820
Thank you very much for watching.

200
00:12:24,150 --> 00:12:29,400
And if you have any questions please post the discussion in the course and then I'll do my best to answer

201
00:12:29,400 --> 00:12:33,030
your questions and I'll see you in the next tutorial.

