So as you can see here these are the lines of code that I pasted here inside this Anchal each method.
So here in line number 100 I created a variable of type integer and the name of this variable is computed
of power integer value.
Right.
So let's actually go inside this computer class as you can see inside this file computer the java file
as you can see we have this instance variables right.
But as you can see here we have free instance variables that are of type integer.
Right.
So let's go back to our main activity class.
So here as you can see I created this variable which is of type integer here so that we can actually
hold the value of this computer power which is going to be streamed inside these variable.
So it computer power integer value.
Right.
Assignment operator operator zero.
So initially I assigned the value zero to this valuable in line number one hundred and one.
We created another variable which is again an integer and the name of this value but is computer speed
integer value assignment operator 0 and inline number of 100 and 2.
As you can see here we have another variable which is again of type integer and the name of this rowdier
but is computerdom integer value assignment operator 0.
So because these variables are of type integer we created them so that they can actually hold these
integer values.
So if I go inside this computer class as you can see here we have these instance variables that are
of type integer.
So insight is Anklage method inside the main activity class.
We created these variables in horde in order to actually hold the the integer value of our computer
power.
Right.
So now we need to actually convert our string value to an integer value.
So let's see how we can do that.
First let me just pasting some lines of code here and then it will make sense.
So as you can see here these are the lines of code that I pasted here.
So we have a try catch block here.
Right.
So let's actually look at this tree block here.
So try and inside the curly braces of these tribal Arch we have this line of code here.
So here I am referring to this valuable computer power integer value assignment operator here.
And then I am referring to the name of this integer class that parse it.
So what does this parse method do this.
If it is going to actually convert a value that is of types 3 to an integer value but it doesn't mean
that if you actually for example pass the value hello to this method it's not going to actually convert
that hello to the to an integer value.
It's just going on.
For example if you pass for example Number 25 to an it takes as you can see here in line number 94.
We have this variable which is of type string.
Right.
And the name of this value is computer power assignment operator.
So here I am referring to the EDT computer power.
So now let me show you the emulator here as I can see this is our emulator and this is our ADC computer
power right.
The user is supposed to actually enter an integer value here.
For example number 23 right.
But if the user enters For example a value that is not an integer for example hello then it's not going
to actually convert this value to an integer value.
It's going to run an error.
Right.
So that's why we actually put this line of code here inside a try block.
And we have also this catch block here.
In order to catch any errors that may occur here.
So for example the user is supposed to actually enter an integer value here for the computer power.
But what happens if the user for example enters the value Hello.
In that case we have an error and it's going to throw an error.
And if we don't get that error our application is going to crash.
Right.
And we don't want that to happen.
We don't want our application to crash.
So we should actually just catch those errors.
So that's why I actually created this try catch block here.
So any time that you may actually expect something to go run.
Make sure to put your own codes inside a truck try church block so that they can actually get those
errors in say the catch block.
Right.
Look at this block I've got here.
Try computer power assignment operator.
So here I am referring to this integer class right integer that parse it.
So again let me tell you that this parts ain't gonna actually convert a value that is of types three
integer value.
Right but for example if I if I here enter the value of 100 here this is going to be an integer value
right.
But here we put this integer value inside these Eadie text.
Right.
And it it takes can only accept a string value.
So it's going actually to convert that value to our street you and we can actually put it here right.
And then we are actually saying that get picks that twisted in.
So it's going to convert that value to run twice think value and it's going to assign that string value
to these computer power.
So this 100 here now is our string value right.
But if we want an integer value.
So here inside is Triple H.
We are converting.
We are saying that convert that integer value to that string value to an integer value.
Here we are saying that converts that string value computer power to an integer value.
So integer parsing computer power that's here right.
So it's going to convert the value of 120 integer value not and not passing value about an integer value
and it's going to assign that integer value to this computer power integer value valuable.
Right.
So if you have this try catch block for disvalue.
So now we have two other variables here.
As you can see this one computer spit integer value.
So let's actually create a try catch block for this one computer with integer value.
And here I can say try.
And then I can open and close describe like by using these curly braces.
And we also must provide a check or catch block so catch and inside the prentices again to say exception
and the name of this argument is going to be.
And here I can open and close this catch block by using these curly braces.
So in this way we can actually write our coats inside this Triple H and inside the catch block we can
catch those errors.
And in that case our application is not going to crash because we already caught the errors right.
So in say the Triple H I can say Computer computer speed integer value assignment operator and that
refers to the name of this class Integer class that parts Int.
And here I can easily refer to the name of this valuable computer speed.
So here inside the prentices I can pass disvalue computer speed and then I need to put a semicolon at
the end of my statement.
And inside these catch block again just like does this error to the console.
So here I can say larg that I first I need to specify the tag which is going to be all of types think.
And here I can say the I am referring to these arguments right.
This argument actually holds the actual error description.
So for example dot get localized message or get a message and then put a semicolon at the end of your
statement.
So they provided a try catch block for this valuable computer spit into the value.
And now let's actually create another try catch block for our.
Another variable which is just one computer rammy integer values so try.
And here I need to provide a catch block.
So now exception inside Apprentice's just put the value exception E..
And then open and close your cataplexy by using curly braces.
And inside is trouble like I can't say the name of what a variable is computer integer value computer
ram integer value assignment operator.
And here I can say integer dot parts in it.
And here I can pass these valuable as you can see here Computerland which is strange.
So here I can see inside the Prentice's computer
RAM.
And then I need to put a semicolon at the end of my statement and in say the catch block I can catch
that error and just put it in the console.
So like that by first I need to specify the task.
And here I can see the dot get message and then I need to put a semicolon at the end of my statement.
So hopefully that makes sense.