And here I want to actually create an ideal array of integer numbers so in.
OK.
And then I need to specify that I am going to create an array by putting in a pair of brackets after
my type name which A and the name of my area is occurrence.
OK.
And then I put in an assignment operator here new it and here I need to actually specify the size of
my arii.
Ok so my Aure is going to actually accept 6 integer numbers.
OK.
And now let's actually create a for loop for.
And inside the prentices of this for loop I want to actually create an integer variable in this pond.
OK.
Then the name of my variable is respondent assignment operator 0.
OK.
And here I need to actually specify a condition for this loop until respond is less than people rates
that lead.
OK.
So this loop is going to be actually executed on till the value of this response.
Valuable here as you can see is less than the value of the length of these people rates.
OK.
And then here I need to actually type in response.
Plus plus.
So after each execution of this loop the value of this response really a Above is going to be incremented
by 1.
OK.
So now inside of these curly braces I want to actually manipulate the values that are inside of this
occurrence arai.
So as you know by default the values are that I should instead of this occurrence rate are actually
zeroes.
And here I want to manipulate those values.
So here I can just type in plus plus occurrence sup.
Respond.
OK.
So in this way for example the value of this response for the first time that this group is going to
be executed the value of this response variable is 0.
OK so this zero is going to be here inside of these brackets.
OK the value of this response variable is 0.
OK so a clearance Sub Zero is going to actually give me the value that is inside of the index zero of
this occurrence.
OK.
So here as you can see we actually created this array.
OK.
And we didn't actually assign any value to this to the index as of this hour.
OK we just specified that this area is going to actually accept 6 integer numbers.
Okay.
And by default the values that are actually inside of the indexes of this Aure are actually zeros.
So here I am saying plus plus occurrence respond.
So for the first time that this rule is going to be executed the value of this responder variable is
zero.
So a plus plus occurrence Sub Zero is going to actually increment the value that is inside of the index
zero of this.
OK increment the value that is inside of the index zero of this aere by 1.
OK.
So hopefully that makes sense.
And now let's actually create after this for a loop.
This is truly create another for loop.
OK.
And here inside of the Prentice's Let's actually create an integer variable int amount.
OK.
Assignment operator number one.
OK.
Semi-colon here.
I need to actually create a condition in which this loop is going to execute.
So until the value of this amount to rebuild is less than the value of the occurrence rate that lenth
OK until the value of this amount variable is less than the value of this of the length of this occurrence.
Ari.
Okay.
And here I am just an amount plus plus.
And here I am saying that after each execution of this for loop it's going to actually increment the
value of this amount variable by VH1.
Okay.
So here inside of this curly braces of this for loop again just our first of all I want to instantiate
these two strange objects that I actually declared here.
OK.
So first I can just type in old t.a exteriorise value.
OK.
Assignment operator here.
I can just type in to 60 rates not get text.
Okay that's too strange here.
I am actually getting the value of these the takes view object and that I am actually converting that
value to a string value so that I can actually assign that's why they you this old to use the rates
value here.
OK.
And here again I can't just type in all DX the number of stars value assignment operator the number
of stars that it takes that to think OK.
And here I am actually getting the value of this RTX the number of stars takes few and I am converting
that's why due to a string value so that I can actually assign that value to this all x number of number
of stars value here.
OK.
And now I want to go out with some values to the screen so I can just typing to the rates that said
text.
And inside Apprentice's first of all I want to output the value of this all t exhilarates value.
OK so that I can actually see the previous values that that actually out with it to this screen.
So here I can just I think old key extracts value plus here I want to concatenate this value 15 U.S.
values or other values plus amount here.
OK I referred to the name of this amount variable so that they can actually read the values of this
amount variable here.
OK.
Again I want to actually take anti-X the number of stars takes a view that said text again.
I want to output the old DX the number of stars value here.
OK so that I can actually see that the previous values plus OK occurrence occurrence.
Sup em out OK here.
As you can see.
First of all you referred to the name of this string object.
OK and then I put a plus operator here and then I refer to the name of this Aure occurrence.
OK so as you can see here this is our Aure that we actually created in line 27 sub him out OK.
And here for the first time that for example.
This loop is going to be executed.
The value of this amount of variable is 1.
OK number one.
So here it's going to actually output number of 1 to the screen and it's going to actually output the
value that is inside of the index number of one of these occurence array.
OK so now after this amount here let's actually create a newline character by default slash in and here
after this occurrence.
Sup em out here.
Put.
A-plus.
Operator And then to double quotes and say double quotes.
Put a new line character here.
OK.
Backward slash an ant.
Now let's actually run our project and see what happens.
OK as you can see here our application actually crashed.
OK.
Unfortunately AB 17 has stopped.
OK so now let's ask you to go inside the log and see what's the cause of this error.
OK.
So as you can see here inside of the lock or key select this android monitor so that you can see the
lugs here and here in order to see the errors here inside the lab level section you can actually choose
error.
OK so that you can only see what's the cause of this error.
OK.
Fatal exception made.
OK.
And here as you can see it says a component info here Jova that landed Arey index out of bounds.
Exception.
Six index six.
OK so here it says that we actually tried to access the index six of this occurrence.
OK.
So as you know in our programming we always count from number zero.
OK.
For example here we actually specified that this Auret is going to accept 6 integer numbers.
OK so we count the values that are actually inside of this occurrence I a Lotus 0 1 2 3 4 5 done.
OK so if we actually count these values here we have 6 integer numbers 1 2 3 4 5 6.
OK.
And here as you can see these are the indexes of this Aure.
Are these six values as you can see are the indexes of this.
OK.
And we cannot actually access the index number six of these because these are a can only accept 6 integer
numbers.
OK so these are the six digit numbers and we cannot for example access and the index number 6.
That's not right.
OK.
That's the cause of our error.
As you can see here it says Java don't like that Arey index out of bounds exception Linfa 6 index 6.
OK.
If we actually click on this blue link here I mean activity that Java 41 here as you can see it says
the cause of this error is this line of code here.
OK.