And then it's going to go again inside of this index zero of this array.
And then it's going to actually give us it's dissuade you appeal to us OK for the company name.
And again for the devices here for the company device here are really fed through the name of these
devices right here as you can see at inside the brackets of this array.
I referred to the name of this index variable.
So now the value of this index variable is number two.
So to module 12 is number two.
OK.
So now as you can see it's going to go in state of the index number two of this Ali.
And then it's going to actually give me this value to me ok.
Galaxy Note 8.
OK.
And then it's going to assign that object to the index number two of this.
OK.
So hopefully that makes sense.
Now let's actually add some more quotes to this class.
OK so now let's actually create a method in this class.
OK.
So after the end in calibrates of this puzzle constructor here as you can see if you want to actually
create another method here we want to actually create effect inside of this puzzle class.
OK.
So before the end in place of this puzzle class I want to actually create a.
So I just pasting some lines of code here and then I explain to you what's going on here.
So now as you can see here these are the lines of code that I pasted here.
And now first let's actually look at this.
Let's shuffle the device's method here.
So the axis modifier of the Smurfette is public.
The return type of this method is void and the name of this method is let's shuffle the devices.
And as you can see here if it actually doesn't accept any arguments.
So let's actually go inside the body of the Smurfette And let's see what's going on here.
First of all as you can see I assigned the values zero to this current device model valuable as you
can see here.
Right.
So that meant that for example when a user calls this method first the value of this current device
model is going to be 0 and then it's going to exiguous this for loop here so forth.
And as you can see I created are valuable here and the data type of this valuable is integer.
The name of this variable is first device assignment operator 0.
So here I created a variable and then assign the value 0 to this value.
But semi-colon and then are here as you can see here.
I actually put this condition here.
So this condition actually determines how many times this fall is going to be executed.
So until the value of this first device here is actually less than the value of the length of this company
and device is arii this loop is going to be executed.
And here as you can see I actually put this value first device plus plus.
So this means that after each execution of this for a loop the value of this first device is going to
be incremented by 1.
So now let's go inside the body of this for a loop here.
As you can see first of all I created over the table here and the name of this valuable is second device
right assignment operator and here as you can see I referred to the name of the secure random numbers
here.
As you can see.
So let's look at this.
So your random numbers here inside this puzzle class as you can see here.
I actually created this constant.
So I actually put this final keyboard and this means that this this is actually a constant.
And here as you can see the data type of this constant is secure random here.
And the name of this constant is secure random numbers assignment operator Nilo secure random.
So here I actually created an object of type secure random and the name of this object is a few random
numbers.
So here this object can actually generate secure random numbers for me.
So now let's actually look at our for loop here.
So I actually referred to the name of my constant secure random numbers that next int number of models.
So it's going to actually give me a random number.
OK.
By looking at the number of models here as you can see inside this class I created this constant here.
Private static final int number of models 60.
So that's our method here.
As you can see by it by calling these next in Mefford on this secure the numbers and by passing this
number of mudholes to this method is going to give me a random number between number 0 and number 59
and then that's value that a random value is going to be assigned to this second device by the bed which
is of type integer.
Right and in line 50 as you can see I actually created an object of type company and device as you can
see here.
And the name of this object is temp company and device Temperley company and device assignment operator.
And here as you can see I've referred to the name of this as a company and devices address.
So here inside this class I actually created an array of pipe company and device as you can see here
in line 11 right.
So inside this puzzle instructor I actually initialized this company and devices at.
So now when the use for example creates an object of type puzzle this company and it was his idea is
going to be initialized as you can see here in line 24.
I am actually initializing this at a company devices.
Assignment operator new company and device number of models as you can see here.
Right.
So here as you can see I to initialize this.
And I said that this this is actually an array that can hold up for example 60 values OK can hold 60
values 60 values of type company and device object.
OK.
So here inside this for loop as you can see here I am actually iterating over the values iterating through
the values of this company and devices.
As you can see.
And then I am saying that company and devices index assignment operator new company and device.
And here I am specifying as you can see here the first value.
And here I am specifying the second value that is specified inside this company and device constructor
OK.
The first value is going to be companies.
And the second value is going to be the devices and here we created these raise in order to initialize
this era.
He had company and devices arii.
So hopefully that makes sense.
And now let's look at our let's for the devices here.
So here I actually referred to the name of this a company and devices and here I actually passed this
first device to this inside the brackets here.
OK first device.
So it's going actually so look it's going to look at this for loop here as you can see.
I created this valuable here first device and then it's going to give me a value for example the first
value.
So the first time that this group is going to be executed it's going to actually give me the first value.
For example the value that is inside of the index zero of these are eight of these company anyway is
at a first device and then it's going to assign that value to the stem company device and 11:51 as you
can see.
I'll defer that to the name of this company and the voters Aure.
And I said that the value that is inside of the index first device as you can see here I want to change
that value assignment operator unable to assign this value to this to the in the index first device
of this company and devices.
So company and devices second valid second device as you can see here.
So it's.
So it's going to change the value that is inside of this first device is going to assign the value that
is inside of the inside of this second device and it's going to actually assign that value to the index
first device of this company and devices at a as you can see here.
Right and in line 52 again referred to the name of this company and devices Arey and I said Now we want
to actually change the value that is inside of the index search and device.
So company in devices second device assignment operator temp company and device.
So as you can see here I actually created this value here teme company and device as you can see here
this valuable actually hold a value of pipe company and device as you can see here.
Right.
So now I can actually assign that value to the index the second device of this company and devices.
So in this way we can actually shop LTE devices that we have inside our application right.
So hopefully that makes sense and if you have any questions please post a discussion in the course and
then I do my best to answer all of your questions.
And as you can see here I pasted these lines of code here.
OK.
So the access modifier of this method is public.
So did the type of the Smurfit the return type of dismay if it is actually company and device.
OK.
So the name of this Meffert is give me the model OK.
And as you can see this is not going to actually accept any arguments.
And as you can see here inside of the Smurfit as you can see these are the lines of code that actually
put inside of this effort.
So first of all I actually created an if statement if the value of this current device model but as
you can see I actually declare this variable inline 12.
So as you can see I declared this variable in line 12 as you can see here and here I referred to the
name of that rowdier.
But if current device model variable is less than OK if the value of this variable is less than the
value of the line of this company and devices are a is going to actually execute this line of code here.
Return companies and devices.
So here I actually referred to the name of this great company and devices sup Canon device model plus
plus.
OK.
So as you can see here inside the constructor of this actually the puzzle here I assign the values zero
to this kind of device model.
And then again I assign the value zero to this current device modeled inside the let's Shafir the devices
here.
OK.
And then here I actually specify that the return value that is inside of this current device model to
me.
OK.
So for example for the first time that this is going to be executed the value of this kind of device
model is number 0.
OK.
So this means that this number 0 is going to be the index 0 of this company and devices.
Right.
OK.
So it's going to go inside of the index zero of this company and the devices are a.
And then it's going to actually return that's of value to me.
Ok return that value to the caller of this method.
OK.
And after that it's going to actually increment the value that is inside of this current device model
right here.
OK.
Plus plus hopefully that makes sense.
So if we actually divert to write this plus plus before the value of a name here.
So in this case it's going to actually increment the value of this current device model first and then
it's going to actually go inside of this company and devices.
So for example before this benefit is executed the value of this current device model is really about
is number 0.
So for us.
So after we are up we call this method is going to actually go inside of this Smurfit and then it's
going to actually check this condition inside of the if statement if current device model is less than
the value of the company and device is great.
And then it's going to actually execute this line of code here.
So inside the brackets here we have specified that plus plus connoted device model is going to increment
the value of this kind of device model first.
Okay for example the value of zero and now the value is number one and then that's number one is going
to be in the index of this company and devices.
So it's going to give me the value that is inside of the index of this hourly and then it's going to
it's going to return that value to me.
I want the value that is inside of the index zero of this array and then it can actually increment the
value of this kind of device model by one and then it can actually to return other values to me else
if the value of this current device model is equal or greater than the value of this land of this company
and the basis of it is going to actually return nodded.
Okay.
And now it means nothing.
For now we don't have to worry about this not here.
It's going to return nothing to us.
OK.
If this condition if this condition evaluates to false OK it's going to actually turn off.
OK.
So hopefully that makes sense.
And let's actually go back inside this main activity of a fight here.
Let's actually do something with these classes that we actually created here.
Company and device class and puzzle class.
So inside of this uncreate Meffert Let's actually create an object from the editor class.
So here I just paste in a line of code here.
As you can see so the data type of object is added text.
And this is the name of an object.
It is the puzzle assignment operator.
And here I cast this object to it it takes up to an edit text object.
And here I said find view ID or dot ID dot EDT puzzle OK.
And here let's actually create a stream object.
OK.
And the name of our object is old.
It is a puzzle value.
And then I need to actually put in a semi-colon at the end of my statement.
So as you can see here I didn't actually instantiate this object here because I just wanted to declare
this up this object yet here this string object.
So now let's actually create an object from this puzzle class.
Ok so here.
So as you can see here the type of object is puzzle.
OK the name of an object is my puzzle assignment operator.
And here I actually instantiated this object.
OK.
So now this object is actually referring to some place in memory.
Ok so now let's actually shuffle the for the devices that are actually inside of this puzzle.
OK.
So I just need to to the name of this puzzle that shuffle the devices.
OK.
So now it's going to actually shuffle the deck for the devices that are actually inside of this puzzle.
OK.
So remember that here in line 23 I actually created an object from this puzzle class.
OK.
So here because I actually instantiated this object the constructor that is inside of this puzzle class
is going to be executed.
OK so now these lines of code here as you can see is going is going to be executed here.
OK.
After the execution of these lines of code we actually called this let's shuffle the devices here.
The Smurfette this let's shuffle the devices move it here on this my puzzle object here.
OK so now let's actually create a for loop here.
So as you can see here this is the for loop that actually created here.
OK.
So as you can see here inside the practices of this for loop I actually created an integer rowdier bill
and the name of this valuable is.
OK.
And then I assigned the value zero to this variable.
And here as you can see I specified I actually created a condition.
OK.
Until it is less than number 60.
OK.
So until the value of this valuable is less than the value of 60 here this loop is going to be executed.
And after each execution of this for a loop the value of this type of argument is going to be incremented
by 1.
OK.
So inside of this for loop as you can see here I referred to the name of this object that I actually
declared in like 20.
OK.
Old EDT puzzle value assignment operator idiotcy puzzle right.
It's a puzzle.
So as you can see here this is the name of the text object.
OK.
It is the puzzle that get text that string.
So here I am actually getting the text of these added text object.
Here as you can see and I am actually converting this value to a string value so that I can actually
sign that value to this all the EDT puzzle value OK.
And in line 51 here I actually want to actually set some text to this EDT puzzle object.
OK.
So it is the puzzle that said text all is puzzle value.
So in this way it's going to actually output the previous values that were actually inside of this text
view here as you can see it's going to out with the old values that were actually inside of the state's
view.
And then it's going to actually be concatenated value with the newest value in my puzzle that gave me
the model.
OK.
So here I actually first to the name of this post my puzzle object that they actually created in line
23 and I actually called the Smurfette on this object.
Give me the models.
So as you can see here inside of this i'll give me them of those Meffert.
I actually put these these lines of code here.
If current device model is less than company devices that lenth company and devices that lenth then
it's going to actually execute this line of code here returned company on devices current device model
plus plus.
So it's going to go inside of this array and then it's going to actually return the value that is inside
of this current device model index.
And then it's going to increments that value by one.
OK.