Plus plus clearance sup response.
Let me explain what's going on.
For the first time that this group is going to be executed the value of this response variable is zero.
OK.
And this loop is going to be executed onto the value of this response to valuable is less than the value
of the land of these people rates every day.
So as you can see here.
So let's actually see what's the length of these people rates are 3 1 2 3 4 5 6 7 8 9 10 11 12 13.
So the length of these people rates really is 15.
OK.
And here you are saying that until the value of this response variable is less than 15.
OK execute this for loop here.
So by the time that the value of the respond value reaches number six.
OK That's number six is going to actually go inside of these brackets here and then it's going to actually
go inside of this occurrence Aure and then it's going at it it wants to actually access the value that
is inside of the index 6 index number six of these three.
So we don't have index number six in this area here.
OK.
So we cannot actually access the value that is inside of the index number six of this very ok because
as you can see these are the values of these are these are the indexes of this houri.
OK.
0 1 2 3 4 5.
We cannot.
You can only access the values that are inside of only these indexes.
OK.
So index number 6 doesn't exist as a result.
You actually see this error here Arey out of bounds exception and that's why our application actually
crashed.
OK.
So in order to solve this error here first of all it naturally comment out this these numbers here and
here inside of these brackets we just need to refer to the name of these people at rates Aure people
rates are cheap brackets keep people rates up.
Respond.
OK.
And in this way it's going to actually go inside these people rates Ali.
OK.
And then it's going to actually give me the value that is inside of these or respond index.
So for example for the first time that this group is going to be executed and the value of this respond
valuable is zero.
OK.
So here for example the value of this response variable is zero.
People rates Sub Zero is going to ask you to give me devalue number one.
OK.
And that number one is going to actually replace this piece of code here.
As you can see so here we have we have actually that actually create a comment here number one.
OK.
So this value is number one now.
So here we have plus plus occurrence number one.
Plus inside the brackets.
OK.
So it's going to go inside the occurrence Aure here.
As you can see and it is going to give me the value that is inside of the index number of one of these
arii.
OK.
And then it's going to actually increment that value by one and then it's going to actually return that
value to me.
OK.
Plus plus occurrence Sup people rates some respond.
OK let me you to explain again here.
So for the second time that this loop is going to be executed the value of this respon variable is number
one.
OK.
So this month plus plus here as you can see it is going to actually increment the value of this respond
variable by one after each execution of this world.
So now the value of this response valuable is one.
So now it's going to go inside of this for a loop.
And here the value of this respon variable is one.
So here we have people rates sub 1.
OK.
So it's going to go inside of the index number of one of these people rates are the index and the value
of the index number of one of these people rates our rate is fourth.
OK.
Disvalue.
So here we have number four inside of the brackets.
So now we have plus plus occurrence Suppe number four.
OK.
So now we have number four inside of the brackets of these Acura unsorry.
So now it's going to go inside of the index number for all of these occurrence.
And then it's going to actually increment.
That's where you Boivin and then it's going to return that value to me.
OK.
So hopefully that makes sense.
And let's actually do our project again and see what happens.
So now as you can see our application launched successfully and here we can see the values here.
Rates number of stars here as you can see.
So as you can see here for the rate number one we have two people with one star value and for the rate
number two we have two people with two stars of value we have.
And for the rate number three for example we have two people we are freestylers value for their rates.
Number four we have free people with a forestalls value.
And for the right for the right for example Number five we have four people need five stars value.
OK.
So now as you can see here you are actually reading the values that are actually inside of these people
rates.
Okay.
And as you can see here inside of these people rates are a you have this value here five.
Again we have this value 5.
Here again we have this value of five here and this value five here as you can see for the rate number
five.
We have four people with five star value.
OK.
So if your actual reading devalues that are actually inside of this area.
So let's I should go I can say this content others like me in that example and here let's actually click
on this clear cut chest here and essentially change the text of this takes you to a number of people.
OK.
Number of people.
And inside of this mine activity that will here as you can see it's actually on our project again and
see what happens.
So as you can see here now are up our application is actually running on this emulator.
And here we can see these values here.
Okay.
So we have for the rates number one we have for example to people with monster value and so on.
OK.
So hopefully that makes sense.
And here let's actually add another value to these people rates right here.
OK.
So here just putting a comma here and here just you can actually put number 6 here for example.
And now let's actually run our project and see what happens.
That may actually deleted this comment here.
And let's actually do our project.
So as you can see here our application is actually crashed.
OK.
Unfortunately at 17 has stopped and this means that that our application actually crashed and we have
a problem in our codes.
OK.
So as you can see here inside the log it says don't bother to learn that Arey index out of bounds exception.
Again if you're actually getting the same error that we got earlier in this tutorial.
OK Len.
Len for six index six.
OK.
So in the main activity that you will find here actually assigned another value to these people rates
are a hit as you can see this is number six.
OK.
Let me ask you to explain what's going on here inside of this for loop.
OK.
So for example inside of this for loop I actually created an integer number and it has a variable.
OK.
And the name of this integer variable is respon OK.
And then I assign the value zero to this variable.
And here I actually created a condition that actually determines that whether this group is going to
be executed or not.
OK.
So for example the value of this response variable is for that for the first time is zero.
This loop is going to be executed until the value of this responder variable is less than the value
of the land of these people rates are that people rates.
OK so now the value of the length of these people rates rate is 14.
OK.
So now inside of this for loop for the first time the value of this respon value bet is zero.
OK.
It's going to actually go.
This value is going to be inside of the brackets of these people rates are here as you can see people
rates respond.
So it's going to actually go inside of the index zero of these people rates away.
So the value of the index zero of these people it really is number one.
OK.
So it's going to give me the value.
Number one here.
So now we have number the value number of one inside the brackets of this occurrence.
OK.
So plus plus carrots sup number one.
OK.
So the value that is inside of the index number of one of these occasions Arey is for example zero.
OK.
So that is going to actually increment that value by one.
OK.
And this group is going to actually continue executing until it reaches this value.
OK.
Number six this number six is the last value that is inside of the people rates Ali.
Ali.
OK.
So let's actually count the values that are actually inside of the people rates are a zero.
OK.
One two three four five six seven eight nine 10 11 12 13 OK.
So this value is actually at the index Fourteen of these people rates are a.
Ok this number six is actually at the index fifteen of these people rates are a.