So hopefully that makes sense.
Now let's actually create another method here.
OK.
So here I'm going to paste this method here.
And then I'm going to actually explain to you what's going on here.
OK.
So as you can see here this is my method.
They are actually pasted here.
And the access modifier of this method is public.
The return type of this method is in integer.
So this method is going to return a value of type integer and the name of this method is calculate the
overall power of animal.
OK.
And here you can see inside of this method I am returning an integer value.
OK so here I am referring to the name of this good animal power method.
So as you can see here this is our Get Alamein our power and foot here and this method actually returns
the value of the animal power.
OK.
Here I notice that I didn't actually directly referred to the name of these animal power instance variable
because in this way my codes are actually more professional.
And this is the most this is actually the best way to write your code so we always refer to your guitars
in order to access the value of those instance variables.
OK.
And here I am referring to the name of this get my power effect multiplied by the value of this or get
any more speed or method as you can see this is the case any more speed.
OK.
And now let's actually overwrite the twisting method that we actually implicitly inherit from the Object
class.
OK.
So remember all all of the classes in Java actually implicitly or explicitly inherit all of the features
and behaviors that are inside of the Object class.
OK so now we can actually override the two string method.
OK.
So I just need to take to and press ENTER key here as you can see I am overwriting the twisting method
that is actually inside of the Object class.
OK.
And here as you can see it says Return superior.
The two string it's going to actually executes the implementation instead of these two string may fit
inside the inside of the superclass.
OK.
Object class.
So I don't need this implementation.
I want to actually put in my own implementations inside of these two string Meffert.
So I can't just delete this line of code here and inside of this method I can actually put in my own
implementations.
OK so here inside of this Peppard I want to actually paste in some lines of code and then I'll explain
to you what's going on here.
OK.
So as you can see here these are the lines of code that they actually put here.
And here you can see I am actually returning right here.
String format.
OK.
It's actually this effort as you can see this format may fit that.
I am actually calling on the string class is going to return up stream object.
OK a string value.
So return string format here instead of these double quotes.
I am actually specifying the format of my string value.
OK.
Percent.
As Kallen percent as percent and our percent is Colan space person as person and person as colon as
you can see here spaced person D is for actually integer values integer arguments.
Percent and is actually up a newline character.
OK.
Percent as call and space percent.
So this person here is actually referring to the name which is actually the argument animal name calling
and this person as here is actually referring to this argument.
Ok this token is for this argument to get any money here.
I actually created a new line character and again a person is here.
So this person is for this argument animal color in space.
And another person is here.
Get any more color here.
OK.
Person X.
And here we have a person and here as you can see this is a new character.
And here I have another at person here and this person is for this animal power colon.
And here I have a person D.
This what this is for.
This gets animal power here as you can see it is good get animal power and if it returns a value of
type integer.
So these folks talking is for this method here.
And we have a new line character again percent as this is animal speed.
OK.
This is for this value colon and present the dispersant the actually is for this get speech here.
OK.
So hopefully that makes sense.
Now let's actually let's actually go inside of these chats class here.
And now it's actually putting some more lines of code here.
So here inside of this cat class A first of all I want to actually are it the animal class from this
cat class.
So I want to inherit all of the features and behaviors that are inside of this animal class here.
So I can't just type in here extends animal.
OK.
In this way I am inheriting all of the features all of the behaviors and instance variables that are
actually inside of this animal class.
OK.
But I cannot see that the instance variables inside of these animal class here.
OK.
So here I can just.
First of all I don't want to create any instance variable inside of this cat class.
So I just need to create a constructor so public chat and inside of the practices of this class constructor
here I need to specify some arguments.
Strange animal name.
OK come on.
Strange Animal color comma in power comma and speed.
OK.
And then I need to open and close this constructor by using these curly braces.
Here and just typing super.
So super refers to the superclass.
OK Animal class.
And now I need to actually initialize a constructor that is inside of the superclass.
OK.
So first of all I need to actually as you can see inside of this animal class these are constructed
and this constructor accepts these arguments.
Animal named animal collect color power speed.
So I need to assign those values to this superhero.
OK animal name come up.
Animal color come on power come our speed.
OK.
And now let's actually create another method here.
So after this constructed as you can see I can actually create another Meffert you want to actually
override the Mefford that is inside of this Animal class.
So this is the method that you actually created inside of this Animal class.
Calculate the power of Alamein.
OK.
In the sake of this math class because I am actually inheriting all of the features and behaviors that
are inside of this animal class I can override that method.
So I need to just refer to the name of that method calculate OK the overall power and then press enter
key on your keyboard.
So this is RMF it outside overload as you can see here publish it calculate the overall power of animal
and inside of this Meffert as you can see it says Return super that calculate the overall power of animal.
So it's two at least two pair here.
As you can see the first through the superclass So the superclass is animal.
OK.
And as you can see here this is our superclass and it says that calculate the overall power of any one.
So it's going to actually execute the implementations that are inside of the superclass.
As you can see the implementation that is inside of this method that is inside of the superclass here
as you can see.
So it's going to actually execute this line of code here to get any more power multiplied by the value
of the good animal speed.
OK.
So I think that's enough for this class here.
This is enough.
And now I want to actually create a two string method here.
So in order to overwrite that method as you can see I guess I can just type in two strings.
And as you can see here these are two string method.
And because this Catulus actually inherits all of the features and behaviors that are inside of this
animal class you are inheriting this two string method that is inside of these animal class.
So this is the string method and we are inheriting this implementation as you can see it says Return
super the string.
So here is going to execute these lines of code that are actually inside of these two string nymphet
that is inside of this superclass OK.
And animal name animal color animal power and animal speed.
As you can see here.
OK.
So hopefully that makes sense.
And now it's actually adding a piece of code here.
So after this return here as you can see I can just typing I can't just put into double quotes and I
can just typing Chad's colon and then I can just put in a plus operator here here and chat's colon as
you can see plus superb that two strings.
So in this way.
Well you want to actually output the value of these two string Meffert to the screen.
We can see that if it is actually called from this cat class.
OK so now let's actually go back inside this lion class here and inside of this class there's actually
are putting some more lines of code here.
So here inside this animal class I went to actually create something send somebody about this.
OK.
That is actually related only to this class.
So these are my instance variables here.