This that operating system assignments operator operating system does start a Super Power assignment
operator Sibiu power and does that RAM.
OK.
Assignment operator ram OK.
So hopefully that makes sense.
And now is actually putting some more lines of code here.
So as you can see here I have a get her get her for this operating system instance variable.
OK.
And then I have a here for this operating system instance variable.
OK.
And then I have another get here for this.
So if you power instance malleable and I have a set here for this Sibiu power an instance variable and
inside of set for a first about I actually created an if statement.
If the value of these CPO power is less than or equal to number 0 or if the value of this argument is
less than or equal to number 0 then throw a new illegal argument exception the value of this Depue power
must be greater than zero.
OK.
And then here I am actually instantiating this instance variable.
Does that power power Sibiu power.
OK.
And here I actually created a getter for this instance variable and here I actually created a set for
this instance variable.
And again I created another if statement if the value of this ram argument as you can see here is less
than or equal to number 0 then Frode new illegal argument exception then the value of the must be greater
than zero.
And here I actually initialized this instance variable at the start of the assignment operator.
So here if the user of this settlement actually are assigned an invalid number.
OK that is one example.
Equal or less than number.
Then that application is going to crash.
OK so now let's actually implement the inherited method that we actually have that actually that is
inside of this computer class.
OK.
Evaluate performance.
So here I just need to type in evaluate a performance.
Now as you can see if you are writing this Moffats or just delete this line of code here and inside
of this method and actually putting our own code here.
OK.
So here inside of this method as you can see I am returning the result of multiplication of these two
instance variables so power multiplied by Ram.
OK so another important point about is these exceptions that are remember that these are.
This is not the right way to write your code.
OK.
But here I just wanted to show you how you can actually use exceptions in your projects.
Ok so now let's actually overwrite the two string method that you actually inherit from the computer
class.
So now let's actually delete this line of code here and now we can actually put in our own implementations
here.
So now I'm going to actually putting a piece of code here and then I'm going to explain to you what's
going on here.
OK.
So as you can see here I am saying that the return string data formats and inside of these double quotes
I am specifying the format of my string value.
So here as you can see this percent as here is actually referring to this super that string here.
And this person here person S is for this spew power here and here is a person f is actually for the
small numbers.
So this is for get Sibiu power.
OK.
Sibiu power instance Raddy but actually is of type double.
OK.
And we have another percent end here.
This is a new line character person as this is for RAM.
Here it is for lab here.
This string by the string value.
OK.
And we have another percent here.
This is for kids right here.
OK.
So hopefully that makes sense.
And now let's actually go inside this tablet computer here tablet computer that of a fine.
And now after the class named after this tablet tablet our computer class name he has just stepped in
he had extents smartphone computer.
OK.
So that is actually and is our relationship between these two classes a tablet computer is our smart
phone computer.
OK.
So hopefully that makes sense.
And he and as you can see this is actually showing us an error.
And if I hover my mouse pointer over the area it says there is not a default constructor available in
actually smart one computer class.
Ok so here I need to actually put in some instance variables.
OK.
So as you can see here this is my instance variable that is specific only to this tablet computer class
private int screen size.
And as you can see here I didn't instantiate this instance variable here.
OK so here let's actually create a constructor for this tablet computer class OK.
And as you can see here this is my constructor for this tablet computer class.
OK.
And this constructed actually accepts some arguments name screen keyboard.
OK.
And here you have this argument operating system Sibiu power RAM and screen size.
OK.
And here because we are actually inheriting all of the features and behaviors that are actually inside
of these smart phone computer class we need to actually initialize the constructor of the superclass.
So super name screen keyboard operating system Sibiu power Lamhe.
OK.
And these are the arguments that this smartphone computer constructive needs.
OK.
As you can see here.
OK.
And now we have actually an instance variable screen size.
And here as you can see this is our argument screen size here.
And here I actually created an if statement if the value of this screen size argument is less than or
equal to number 0.
Then a new legal argument.
Exception the screen size must be greater than number 0.
OK.
So here I just need to type in greater.
And as you can see here and I actually instantiated this instance valuable destock screen size assignment
operator screen size.
And now this actually creates our getter and asserter for this screen size instance variable.
So just right click here and say that this class generates getter and setter screen size.
OK.
So this is the so these are actually that are getter and the Center for our own instance variable.
And as you can see here it doesn't show us any error.
OK.
Because this smartphone or computer class as you can see here is inheriting all of the features and
behaviors that are inside of these abstract computer class.
OK.
And inside of these are smartphone or computer class I actually implemented this evaluate performance
Smiffy.
This is actually an abstract method OK inside of a tablet computer class.
We actually don't need to again implement that method.
OK.
Inside of these tablets computer class I don't need to actually implement that method again.
OK.
If you don't want to actually change the implementation of this method OK because I actually inherit
all of the features and behaviors that are actually inside of this smart phone computer class or case
I actually inherit this method here.
OK.
And this implementation.
And if I don't want to actually change this implementation inside of this tablet computer class I don't
need to actually overwrite that method here again.
And if I actually call this method this evaluate performance Smurfit on an object of this tablet computer
class is going to actually return the result of my multiplication of the value of the C-u power and
the value of the land to me.
OK so now let's actually overwrite the two string method here inside of this tablet computer class.
OK.
And delete this implementation inside of this method.
And now we can actually put in our own implementations inside of these two string Meffert.
So as you can see here I'm going to actually pasting a piece of code here and then I'm going to explain
to you what's going on here.
So as you can see here it says Return string format.
OK.
And say that the double quotes I am specifying the format of my string value.
Percent.
S is for super.
That was 3M.
So remember super is referring to the superclass.
So in this case the superclass is smartphone computer OK.
And inside of this smart phone computer we have these two three method.
As you can see here.
So it's going to actually return this string value to me.
OK.
So you support that with strong super strength Sibiu power gets you power as you can see here and ram
Guthrum OK.
And here as you can see inside of these two string Meffert we are referring to the Super Tuesday.
So it's connected to return that string value to us percent.
And this is actually a new line character and we have another person as he he here screen size colon
and we have person here.
So this gets screen size here as you can see returns a value of type integer.
OK so personally is for arguments of type integer.
OK.
And now let's actually go back inside the main activity that job fine here and now we've been actually
putting some lines of code here.
So here inside of this uncreate method let's actually create some objects from the text class.
OK.
As you can see here I created some objects from these are text for your class.
So as you can CTX the desktop computer and here I referred to the name of this idea or that identity.
The desktop computer SD takes the laptop computer.
And here I refer to this ID are that ID the laptop computer geeks the smart one computer or the smartphone
computer takes the tablet computer art that's 86 that tablet computer.
And here as you can see the desktop computer performance takes the desktop computer performance takes
the laptop computer performance and as you can see are that I.D. takes the laptop computer performance.
And here we have this theory the smart phone computer performance.
And here I have art that Id thought TXI the smartphone computer performance.
And here I have the XTi tablet computer performance and here as you can see the tablet computer performance
is OK.