Double that part stubble.
So as you can see we have a class called Double And this is actually a static effect of this of this
class stubble.
And we are actually calling this Meffert and this class and here we are actually putting this string
value as a parameter to these Meffert.
OK.
Double parse double and the string value.
Here we are actually converting this string value to a double value.
OK.
Again let's actually create another double variable number two assignment operator double that part
stubble EDT Nahm to dot text dot to a string.
OK.
Again another double variable double Nahm three assignment operator double that part's double EDT.
Now I'm free.
That's good.
Text that too strict.
OK.
So hopefully that makes sense.
Here I am actually reading the values of these textfield and I am actually converting that values to
add double value and I am assigning that those double values to these are double value.
OK.
So let's actually create another double variable and the name of this variable is result.
Assignment operator and now I want to actually get the maximum number of these free double values.
OK.
So let's actually create Smurfit here.
Outside of these uncreate method and inside of these main activity class let's actually create a method.
Ok everyone.
Now let's actually create a method here public.
And as you can see that the access modifier of this method is public.
And now I want to actually specify a return type before my method double and the name of my method is
get the maximum.
And then in say the prentices I want to actually specify that this method is going to accept some arguments.
OK.
Double and the name of my first argument is number one comma double.
Number two comma.
Double free.
OK.
And then I need to actually open and close my method by using these curly braces.
And here I want to actually get the maximum of these free double values.
OK.
So first let's actually create a WRGA double and the name of my variable is the maximum value.
And then I put an assignment operator here and then I can actually assign one of these arguments to
my valuable.
So I prefer to assign numbers but not one argument to my variable number one semicolon.
Here I am actually assuming that the value of this number one value number one argument is the maximum
value.
OK.
So let's actually create an if statement here if Number two is greater than the maximum value.
OK.
The maximum value assignment operator 2 OK.
Here I am actually specifying that if the value of this Nahm two argument is greater than the value
of this the maximum value then assign the value of this number two variables to the maximum value value.
OK.
And here I am actually saying that if the value of this number two argument is greater than the value
of this the maximum value then assign the value of this Nahm to argument to this at the maximum maximum
value of value.
OK.
That's actually create another IIF statement here.
If the value of this free variable is greater than the value of this the maximum value then assign the
value of the is now free variable to this.
The maximum value variable.
Ok now I'm free.
OK.
So here I need to actually return a value of type double from the Smurfette.
So I can't just type in return the maximum value.
OK.
So hopefully that makes sense.
And let me actually explain again.
First of all we assumed that the value of this number one variable is the maximum value and that we
created two statements here.
And first of all we said that if the value of this not too valuable is greater than the value of these
are the maximum value variable then assign the value of this not to argument to this the maximum value
variable and if the value of this non-free variable this argument is greater than the value of this
stomach the maximum value variable then assign the value of this no free variable to the maximum value
variable.
Okay.
And then with the deterrent value of this the maximum value value of it.
Okay.
So hopefully that makes sense.
And let's actually go back inside this uncle explain it.
And here I can just typing get the maximum and now I need to make sure the passing free double values.
So I want to actually refer to these is Nahm number one comma not too comma free and that I need to
actually put a semi-colon at the end of my statement and then I want to actually output these values
to the screen so I can just type in.
So here I can just type anti-X the result that said text and then I can just refer to the name of this
result variable result.
And because this variable is actually of type double we cannot assign that value directly into this
RTX the result object.
So we need to actually convert this value to our string value.
So I can just put in our Plus operator here.
And then I can just put it into double quotes here.
OK.
So as you can see now this value is actually converted to a string value.
OK.
Now let's actually run our project and see the results.
Ok everyone.
Now as you can see our application is actually running on this emulator.
So here for the first textfield I can just put in a value.
So just click on this textfield.
And now as you can see the virtual keyboard is actually appearing here.
So just click on these numbers and I can just assign a number here for example number for 50 and for
the second textfield I can assign another value for example number 70 and for the first textfield I
can assign an added value.
For example number 100.
OK.
And if you want to disappear this keyboard you can just click on this little triangle here and then
you can just click and this get the maximum value.
So as you can see them the maximum value of these free text fields is numbered 100.
OK.
So let's actually change the value of this textfield here so I can just delete this number and I can
assign another value for example number 400.
And there's actually I click on this get the maximum value here as you can see now the maximum value
is 400.
And this data point zero here means that this value is actually a double value.
OK.
So hopefully that makes sense.
Let's actually go back inside our coats.
Main activity that will find here and after this are set on a quick listen in Meffert as you can see
after the end of this method I can refer to the name of these PTEN secure random number that set unclick
listener new view that Uncle is listening.
OK.
So as you can see here now we can actually put our own coats inside of this method.
So now let's actually create an object from the secure random class.
So Sahira and M-class is a class in Java so secure random class is actually a class a predefined class
in Java that actually produces secure random numbers OK which we can actually use in your own games
or your own applications.
OK.
And I highly recommend you that you actually use this class this class if you want to produce a secure
our random numbers for your applications.
So here I actually referred to the name of this class now.
And as you can see here if I click on these free dots here as you can see now these are the classes
that you actually imported into a file.
And one of these are classes.
If you have these secure random class that is inside the Java security package and this class is inside
of this package.
Ok secure random and we can actually use this class here.
So secure random and the name of our object is secure random number OK.
Assignment operator new and again I need to refer to the name of this secure random class.
And now let's actually create an if statement here.