Hi everyone it is literally all we're going to go ahead and continue building our fourth Android application.
Let's go actually inside this Leppert class.
And as you can see this is our first class.
OK.
So first as you know Leppert is inside the chad family animals.
OK.
So we can actually extend from the cat class here extends.
OK and we can actually inherit all of the features and behaviors that are inside this math class.
OK.
So as you can see here first let's actually create a characteristic that is only specific to this first
class.
Ok for example a leopard has sharp claws.
OK.
So you can't just create a private strength and the name of my instance variable is class assignment
operator.
And then I put into double quotes here and then instead of double quotes I can just type in shot.
OK so now let's actually create a constructor OK for this leper's class.
So first of all I need to type in public.
And then the name of my constructor must be the same as the name of this class.
And then I actually open and close this constructor by using these curly braces.
OK so first of all I need to actually initialize the constructor of the superclass because this leper's
class is is actually inheriting all of the features and behaviors that are inside this chat class into
These are Lepus class we need to actually initialize the constructor that is inside.
These are trans class here.
OK.
As you can see we've got a custom constructor in this class so we need to actually initialize this constructor
here.
OK.
So I can just take it super And then inside the prentices I need to actually pass some arguments here.
OK let's actually specify these arguments here for this Leppert constructor.
So the first argument should be of types 3 and name.
OK.
Again the second argument should be of types 3 inch color comma.
OK.
So let's actually go inside this class and see are there arguments.
OK.
Name calling and I'm out of speed.
OK.
So int amount of speed comma end amount of power.
OK come on.
Let's the other arguments.
A number of lakes and can hunt other animals.
OK.
And number of legs
comma and Boullion Chan hunt other animals.
OK.
So let's actually create new line here and inside Apprentice's here for the super.
I can just passing these values.
Name comma color comma amount of speed comma.
Amount of power.
OK.
Comma number of Lex comma Trahant other elements.
So as you can see here if you have successfully initialized the constructor of the superclass.
OK so now we can actually initialize.
So now we can actually initialize this class instance variable.
Can actually give values to our instance variables or we can actually just don't give a value to this
instance variable.
And when we actually create an object from the Slipper's class which has passed a value for these class
instance variable OK.
So for this class instance variable.
Let's actually create an argument here.
So strange class.
OK.
And now I can actually initialize this instance variable here so I can just refer to this to this instance
variable by just typing this.
That class assignment operator class.
So hopefully that makes sense and then I can actually create a set here and they get in my bed for this
class instance variable.
So let's actually right click on these chat class outside of this constructor here and then click on
generate and and click on get her and set her and then choose this class instance variable and then
click on OK.
This is a get here for this class instance variable.
And this is all set up for this class instance variable.
Ok so now let's actually override the two history if it that we actually inherit from the math class
and the class inherit the twittering Meffert from the Animal class and the Animal class inherits these
to a string Meffert from the Object class.
OK.
So this Leppert class in indirectly inherits all of the behaviors and features that are inside this
object class.
OK.
So hopefully that makes sense.
So let's actually go inside the Leppert class and let's actually referred to this method here and now
as you can see it says Return superb that stream.
OK.
So super refers to that superclass.
So the superclass is chat's as you can see this is our Meffert that is inside this CAD class.
So it's can actually execute this line of code here.
OK.
And then we can actually put a plus operator here.
Strange dot format.
And then inside the prentices I can just put in two double quotes here.
First I need to actually specify the formatting instructions here and then we need to actually pass
arguments.
OK.
So percent as Colan percent B.
And then I put a comma here and then I put two double quotes in order to actually putting a string literal
here in order to relate this string literal to these.
US is talking here OK.
Percent.
So I can just typing class and then I actually put in a comma here and then I need to actually put in
here an argument of type Boolean.
So I can just refer.
So here I just put in percent as Colan percent S OK.
And then I put in a comma here.
So first I need to actually put in a string literal here in order to relate this string literal to the
spoken here person s so I can just type in class OK.
And then I put in a comma here and then I need to actually again put in an argument of types here which
we can relate that argument to this token here percent.
OK.
So this is our instance variable.
So I can't just refer to this instance variable clause.
So as you can see here now are twisting if it is ready.
OK.
But just one line of code we have managed to successfully put in our own implementations and then we
can actually output the value of these value as art to the screen.
OK.
So here as you can see with it just typing here super.
That was three.
And then this can actually execute the implementation of steadily inside these two string Meffert inside
this class.
OK.
So this is our implementation as you can see here.
So let's actually go inside this main activity that Jawa here and then let's actually create an object
from.
Let's have the class.
OK.
So I can just type in here Leppert and the name of my object is my Leppert and and I put in an assignment
operator here.
New Leppert.
And here we need to actually passing this instance these values here.
OK.
So the value of the first argument should be of types 3.
And here we need to actually specify the name of our object.
So I can't just put into double quotes here inside the double quotes.
I can just type in my Leppert.
OK.
And then I put in a comma here and then I need to actually again put in a value of type string here.
And here we need to actually specify the color of our leapers.
OK.
So I can't just put into double quotes here.
For example yellow and then putting a comma here again as now I need to actually specify the amount
of speed of our Leppert object.
For example 400 and then putting a comma here and now I need to actually specify the amount of power
of our Leppert here.
So I can just put in a value of type Integer for example 200 comma.
Now I need to specify the number of legs of our object which is of type int OK for comma.
And now I need to actually specify that whether our object can hunt other animals or not.
So as you can see here we need to actually put a value of type Boolean.
So true or false.
Ok so I can just type in true comma.
And finally even if you actually specify the class of our object here.
OK so I can't as you can see when need actually putting a value of type string.
So I can just put it into double quotes here.
And then inside the double quotes I can just type in sharp K and then I need to put in a semi-colon
at the end of my statement.
Now I can just type in here anti-X the leopard.
That said text.
And inside the parenthesis I can just refer to the name of this object my Lepard that too strange.
Now we can run our project and see what happens.