The superclass is the Object class.
OK.
And inside the Meffert as you can see here it says Return So pair that to a stranger.
It means that it can actually implement the codes that are inside the two string Mefford inside the
Object class.
OK.
It's going to implement this line of code here.
OK.
So we don't want this line of code to be executed in our chat class so I don't want these super strange
code to be executed so I just delete it here.
OK.
So our superclass is object.
OK.
Object here.
OK.
And when it says Return a super.
That was three and it means that this class implements this code that is inside these two string method.
OK.
So let's go back inside the chatter Java class here and now I want to actually put my implementations
inside this method.
OK I want to actually put my own code inside this method OK.
That is actually specifically related to these cathe class.
OK.
So inside this Meffert I just need to type in here return as three dot format and then inside Apprentice's
I need to actually specify the format of this string value.
So as you can see here the Smurfette returns a value of type string.
Ok the return type of this method is strange.
So we need to actually return a value of string here.
Returns 3 in that format.
And first of all I want to actually specify the formatting instructions.
So I just put into double quotes and then inside the double quotes I just type in percent as Colon space
per cent as space percent as Colon percent as space persons as Colon space per cent the space present
as Colon space percent the space per cent as space per cent.
And then I actually put a comma here and now I want to actually specify the arguments that are going
to be related to these tokens here.
OK.
So for example for this token here I need to actually specify an argument of type 3.
OK.
Because this talking is per cent as is stands for strange.
OK so s is for string values.
Ok so I just need to type in here.
So I just need to put in two double quotes here name as you can see I put a string literal here.
This name is for this a token here.
And our second talken is present as.
So we need to actually specify an argument of type strange name.
I refer to the name of the name instance variable which is of type string here comma and that our first
Torchin it again is present as.
So I just need to put in into double quotes here and that inside the double quotes I just type in color
and then I put a comma here.
And as you can see here again are form of talken is percent.
So when you actually put a value of type three in here.
So I just refer to the name of the color instance variable comma.
Again our fifth fortune is present as as you can see here.
So we need to actually specify an argument of type strength.
So I just need to put in two double quotes here instead of double quotes.
I just type again just typing speed and then I put a comma here and then as you can see here percent
D.
So we need to actually put an argument of type integer.
So I just need to refer to the name of the amount of speed instance variable and then I put a comma
here.
And again here I need to actually specify an argument of types 3 in here because this token here is
percent.
OK.
So I just need to put into double quotes power and then I put a comma here and again as you can see
distortion here is percent D.
So we need to actually put an argument of type integer here.
So we just need to refer to the name of the amount of the name of the amount of power the instance variable.
And then I put a comma here.
And as you can see here again we have a present as here.
So we need to actually put a value of type 3 in here so I can just refer here so I can just put in two
double quotes here and there.
Inside the double quotes I can just type in number of legs and then I put a comma here.
And as you can see here we have these percent D here.
So we need to actually put up an argument of type integer.
So I can just refer to the name of the name of the number of legs instance variable.
And we have another instance variable here which is of type Boolean.
OK.
So in order to specify that we are going to actually put up a boolean value here.
We need to actually put a token here.
OK for the boolean value Bellis so we can just put in percent B.
So this percent B is for boolean variables.
OK so here I can't just put a comma here and then I can just refer to the name of my instance variable.
Chan hont other animals.
OK.
And then I put a semicolon here.
So in order to specify what these I can hunt other animals instance variable relates to again just putting
another string value here before this instance variable.
So I can't just putting in a percent here and then I can just put in two double quotes here and here.
Inside.
Inside these double quotes I can just putting in for example fight.
OK.
And then I put a comma here.
So now let's actually go back inside the main activity that Java right here.
Now as you can see inline 42 I called this method on this Kathe one object here.
OK.
So because we write that these are two strings Meffert here is going to actually call only the Smurfette
here.
OK.
So if I had on my project.
Now let's see what happens.
So as you can see here this is the value that is output at here.
OK name my chat color white speed 40 power 50 number of legs for fight true.
OK.
So hopefully that makes sense.
Now I want to actually show you again the power of inheritance in Java.
Let's go back inside the cat the job fight here and now as you can see we've got a lot of duplicated
codes that are inside the animal class here.
OK.
So as you can see in reality these two classes can be related to each other.
This math class and this animal class can be related to each other.
OK.
And a cat can be an animal.
So our cat is an animal so we can actually inherit from the Animal class.
OK so Chad extends animal.
OK.
So as you can see here now it's going to actually show us some errors here.
OK.
So because if you are inheriting all of the features and behaviors that are inside the Animal class
we can actually delete some of those duplicated coats for example DS for instance variables name color
amount of speed and amount of power.
We don't need these instance variables here because we are inheriting all of the behaviors and characteristics
inside this Animal class as you can see because these are instance variables here.
So we don't need these are instance variables inside the Kathe class.
So if I just want to delete this instance variables here.
Now I've got two instance variables that are related only to this math class.
OK.
Number of legs can hunt other animals.
OK.
So as you can see here let's actually delete some of these codes here.
These getters and setters which we don't need them as you can see get get em out of power set amount
of power get em out of speed set amount of speed get color get training.
OK.
And as you can see here we've got only these MFX here.
Get our Chan hunt other animals so they can hunt other animals which is for this instance valuable here.
And we've got a get in my faith for this number of legs instance variable here.
OK.
And as you can see here we can actually delete these lines of code here again and we can actually delete
these arguments here.
As you can see three color as you can see here in that amount of speed.
OK we don't need this here.
And we only need this number of legs soluble and these are Chan hont other animals valuable OK.
And now here again we can actually change the implementation's that is inside these two string Mefford.
So analogus actually did it this line of code here and then I'll actually show you how we can actually
put our own code again in inside this Meffert here.
OK.
OK everyone.
Now that's enough for this theater.
And in the next tutorial we're going to actually continue building our fourth Android application.
OK.
So thanks for watching.
And if you have any questions please post the discussion in the course and then I'll do my best to answer
your questions.
Thank you for watching and I'll see you in the next tutorial.