1
00:00:00,480 --> 00:00:01,430
OK everyone.

2
00:00:01,440 --> 00:00:08,100
Now let's actually go back inside this main activity double file here and now we're going to actually

3
00:00:08,100 --> 00:00:09,560
put some lines of code here.

4
00:00:09,570 --> 00:00:10,120
OK.

5
00:00:10,260 --> 00:00:10,770
OK.

6
00:00:10,770 --> 00:00:16,910
Now we want to actually output the value that is inside of the index 5 of this away.

7
00:00:16,920 --> 00:00:22,880
So this is the index zero index one index to index free index for.

8
00:00:23,010 --> 00:00:24,360
And this is index 5.

9
00:00:24,360 --> 00:00:24,990
OK.

10
00:00:25,140 --> 00:00:28,950
So now here again just putting this line of code here.

11
00:00:29,010 --> 00:00:35,730
So as you can see here TXI the original element that's a text string add a sub in the ex-wife.

12
00:00:35,730 --> 00:00:36,190
OK.

13
00:00:36,300 --> 00:00:41,040
So this piece of code here is going to actually give me the value that is inside of the index.

14
00:00:41,040 --> 00:00:44,700
Five of these screen Arey here as you can see.

15
00:00:44,760 --> 00:00:46,980
So another section is on our project.

16
00:00:46,980 --> 00:00:47,520
OK.

17
00:00:47,550 --> 00:00:51,330
Now as you can see here our application is running on this emulator.

18
00:00:51,480 --> 00:00:57,630
So here if we actually scroll down the screen here you can see this value here.

19
00:00:57,630 --> 00:00:58,090
OK.

20
00:00:58,200 --> 00:00:59,590
If the letter if.

21
00:00:59,640 --> 00:01:00,060
OK.

22
00:01:00,090 --> 00:01:03,660
What do you do not add every element value is dollar sign.

23
00:01:03,720 --> 00:01:04,180
OK.

24
00:01:04,320 --> 00:01:11,040
So here because we actually modified the Auret devalues that is actually the inside of the ARII here

25
00:01:11,160 --> 00:01:17,030
in line 40 as you can see here we actually called these Let's modify the array method here.

26
00:01:17,370 --> 00:01:23,790
So because we modified the values that are actually inside of this are we now the leader if is actually

27
00:01:23,790 --> 00:01:26,730
preceded by actually a dollar sign here.

28
00:01:26,810 --> 00:01:34,080
OK so now let's let's actually go back and say this main activity that job fight here and here I want

29
00:01:34,080 --> 00:01:39,690
to actually manipulate a specific element that is actually inside of these three elements.

30
00:01:39,690 --> 00:01:40,170
OK.

31
00:01:40,320 --> 00:01:43,060
So let's actually create a method for that job.

32
00:01:43,140 --> 00:01:43,730
OK.

33
00:01:43,980 --> 00:01:49,840
So again the access modifier of if it is public the return type of RMF it is void.

34
00:01:49,920 --> 00:01:53,300
So this means that RMF it is going to actually return nothing.

35
00:01:53,520 --> 00:01:54,000
OK.

36
00:01:54,150 --> 00:02:01,790
And the name of RMI if it is let's modify element OK.

37
00:02:01,900 --> 00:02:08,410
And here inside of the practice's I need to actually specify an argument for the Smurfit so that the

38
00:02:08,410 --> 00:02:10,720
data type of argument is strange.

39
00:02:10,930 --> 00:02:11,510
OK.

40
00:02:11,770 --> 00:02:14,760
And the name of our argument is element.

41
00:02:15,480 --> 00:02:16,060
OK.

42
00:02:16,240 --> 00:02:21,880
And then I need to actually open and close this method by using these curly braces and inside this method

43
00:02:21,930 --> 00:02:27,970
I want to actually manipulate these element values so I just need to refer to the name of this element

44
00:02:28,380 --> 00:02:29,130
argument.

45
00:02:29,140 --> 00:02:29,560
OK.

46
00:02:29,650 --> 00:02:36,540
Assignment operator and here inside the double quotes I can just type in and sign hash tag.

47
00:02:36,780 --> 00:02:37,280
OK.

48
00:02:37,330 --> 00:02:39,350
Plus element.

49
00:02:39,730 --> 00:02:45,580
OK so as you can see here I actually put this value here inside of these table codes here before this

50
00:02:45,640 --> 00:02:46,550
element here.

51
00:02:46,570 --> 00:02:46,950
OK.

52
00:02:47,020 --> 00:02:55,150
Before this element of argument and now I can actually output this value the element value to this screen.

53
00:02:55,150 --> 00:02:58,040
OK so I can't just type anti-X the.

54
00:02:58,060 --> 00:03:06,340
So as you can see here I want to refer to one of these objects here as you can see to the modified array

55
00:03:06,340 --> 00:03:06,860
element.

56
00:03:06,880 --> 00:03:07,480
OK.

57
00:03:07,690 --> 00:03:13,630
And as you can see here inside of these let's modify elements I cannot refer to this object.

58
00:03:13,630 --> 00:03:21,100
OK because this object this to this takes view is actually it created inside of these uncreate Smurfit.

59
00:03:21,190 --> 00:03:21,660
OK.

60
00:03:21,790 --> 00:03:29,420
And we cannot actually refer to a valuable to add to an object that is actually created in another method.

61
00:03:29,470 --> 00:03:38,230
So here I can just declare this object so I can just copy this takes beauty actually modify every element

62
00:03:38,230 --> 00:03:44,590
here and then I can just put it inside of this class and then I need to put in a semicolon here.

63
00:03:44,800 --> 00:03:45,280
OK.

64
00:03:45,340 --> 00:03:48,020
And then I can just delete this takes you here.

65
00:03:48,310 --> 00:03:48,550
OK.

66
00:03:48,580 --> 00:03:55,840
In this way we declared this takes you inside of this class and here inside of this uncreate method

67
00:03:55,840 --> 00:03:58,660
you are actually instantiating this object.

68
00:03:58,690 --> 00:03:59,450
OK.

69
00:03:59,460 --> 00:04:01,390
TXI the modified array element.

70
00:04:01,520 --> 00:04:09,410
And now inside of this let's modify elements I can totally fair to that object as you can see here takes

71
00:04:09,520 --> 00:04:11,500
the modify R8 element.

72
00:04:11,530 --> 00:04:13,690
So let's actually test and see what happens.

73
00:04:13,690 --> 00:04:17,990
Let's modify three elements so I can refer to the name of the text you now.

74
00:04:18,030 --> 00:04:18,530
OK.

75
00:04:18,610 --> 00:04:22,780
That said text element.

76
00:04:22,780 --> 00:04:26,590
And now let's actually call this method here.

77
00:04:26,800 --> 00:04:30,440
Let's modify element.

78
00:04:30,460 --> 00:04:35,510
So now I need to actually provide a value as an argument for this method.

79
00:04:35,530 --> 00:04:35,970
OK.

80
00:04:36,130 --> 00:04:40,070
So as you can see the data type of my argument is strange.

81
00:04:40,180 --> 00:04:43,100
OK so I need to actually provide a value of types 3.

82
00:04:43,240 --> 00:04:47,740
So here I can just refer to the name of this thing a sub index.

83
00:04:47,790 --> 00:04:51,420
OK so in this way I can actually get this value.

84
00:04:51,430 --> 00:04:52,270
OK.

85
00:04:52,580 --> 00:04:55,800
The value that is inside of the index five of this.

86
00:04:56,020 --> 00:04:59,190
So as you can see this value if a newline character.

87
00:04:59,200 --> 00:04:59,760
OK.

88
00:05:00,130 --> 00:05:02,850
And here I can just put it here.

89
00:05:02,900 --> 00:05:06,040
String already sup in the.

90
00:05:06,250 --> 00:05:06,860
OK.

91
00:05:07,060 --> 00:05:10,990
So let's actually run our project and see what happens.

92
00:05:10,990 --> 00:05:15,530
So now as you can see our application is actually running on this emulator.

93
00:05:15,760 --> 00:05:22,300
And here if we actually scroll down the screen here I want to actually see this value here a modified

94
00:05:22,420 --> 00:05:23,770
array element at sign.

95
00:05:23,770 --> 00:05:25,790
Hash tag dollar sign.

96
00:05:26,020 --> 00:05:32,850
OK so now I want to actually output the value of every element after modification.

97
00:05:33,010 --> 00:05:33,630
OK.

98
00:05:33,760 --> 00:05:39,280
So after the modified added element as you can see this is this area is now for example modified.

99
00:05:39,280 --> 00:05:46,900
OK so now again I want to output the original value that is inside of the index five of these three.

100
00:05:46,970 --> 00:05:48,560
OK staring at it.

101
00:05:48,580 --> 00:05:50,240
So let's see what happens.

102
00:05:50,440 --> 00:05:52,480
And here after this line of code here.

103
00:05:52,660 --> 00:05:57,280
So just type in here takes the element after the modification.

104
00:05:57,660 --> 00:06:08,960
OK that said text string and a sup in the ex-wife and now it's actually an art project and see what

105
00:06:08,960 --> 00:06:09,530
happens.

106
00:06:09,590 --> 00:06:12,850
So now our application is actually running on this emulator.

107
00:06:12,860 --> 00:06:17,790
And now if we actually scroll down the screen here let's see what happens.

108
00:06:17,810 --> 00:06:23,760
So as you can see here value of the element after modification is dollar sign F..

109
00:06:24,020 --> 00:06:31,940
OK so the most important point I want you to actually know is that when ever we actually modify the

110
00:06:31,940 --> 00:06:39,320
values that are actually inside of an array as we did in line 42 Let's modify the error here elements

111
00:06:39,320 --> 00:06:43,510
that are actually inside of that array are going to be modified ok forever.

112
00:06:43,730 --> 00:06:44,360
OK.

113
00:06:44,600 --> 00:06:51,350
Because when we actually create an array you are actually creating a reference to some objects to some

114
00:06:51,350 --> 00:06:52,730
value inside of the memory.

115
00:06:52,730 --> 00:06:53,130
OK.

116
00:06:53,180 --> 00:06:59,270
And when we modify that array the values that are actually inside of that are they are going to be modified

117
00:06:59,270 --> 00:06:59,690
too.

118
00:06:59,750 --> 00:07:00,260
OK.

119
00:07:00,500 --> 00:07:08,160
But when we actually modify a specific element that is actually inside of an array as we did here.

120
00:07:08,320 --> 00:07:08,770
OK.

121
00:07:08,870 --> 00:07:10,850
Let's modify element OK.

122
00:07:11,060 --> 00:07:15,720
Only a copy of that modified element is going to be created.

123
00:07:16,090 --> 00:07:16,600
OK.

124
00:07:16,760 --> 00:07:20,040
And then that value as you can see on this emulator here.

125
00:07:20,230 --> 00:07:22,800
This is that why you sign hash tag dollar sign.

126
00:07:22,820 --> 00:07:23,440
OK.

127
00:07:23,660 --> 00:07:26,180
But the original value is not changed.

128
00:07:26,180 --> 00:07:31,470
OK because we only modified our specific elements that is actually inside of that of that array.

129
00:07:31,490 --> 00:07:32,030
OK.

130
00:07:32,060 --> 00:07:37,240
And as you can see here value of array element after the modification is dollar sign.

131
00:07:37,550 --> 00:07:43,750
So then if we actually create an array we are actually creating a reference to that Ari.

132
00:07:43,850 --> 00:07:48,520
So that's why the values that are actually inside of this are actually modified.

133
00:07:48,560 --> 00:07:49,040
OK.

134
00:07:49,220 --> 00:07:54,450
So hopefully that makes sense and I think that's enough for this tutorial.

135
00:07:54,920 --> 00:08:00,440
And if you have any questions please post the discussion in the course and I'll do my best to answer

136
00:08:00,440 --> 00:08:01,330
your questions.

137
00:08:01,420 --> 00:08:05,800
And thank you very much for watching and I'll see you in the next tutorial.

