So for example our this is our Get Real Meffert for for my Chan hunt other animals are instance valuable.
OK.
Can hunt other animals.
I don't like this name so I just did it.
This is here.
And I just type in get can hunt other animals.
OK.
So as you can see here we've got acetyl my favorite for this can hunt other animals said can hunt other
animals.
OK.
We've got a good term effort for this.
Get a number of legs for instance variable here.
This is the number of legs instance variable as you can see this is a constant.
OK.
So we cannot actually change the value of this instance valuable from another MFL or class.
Once we give a value to this instance valuable OK so we only can actually create a getter method for
this number of instance variable.
OK because this is a constant.
So as you can see here the Android studio only generated a get fit for this number of likes instance
variable.
We don't have any search term for this.
A number of instance variable OK this is only our Get help method.
OK publish and get a number of leks returnable Oblak number of links.
And here we have this gets amount of power methhead as you can see this is a good fit for the amount
of power instance variable.
OK.
And this is a settlement worth for the amount of power instance variable.
This is our Get and my faith for the for the amount of speed instance variable.
And this is a set in my faith for the amount of spit instance variable and we've got these two getter
methods for the color instance variable and for the name instance variable as you can see here these
two instance variables are constants.
Okay.
So as you can see here we cannot change the value of these two instance variables from another method
or class.
Once we give a value to these instance variables.
So the Android studio only generated a getter method for these instance variables here.
OK.
Get caller get name.
OK we don't have a certain method for these instance variables here.
OK.
We cannot create a certain method for this instance variables because we declared these instance variables
as constant.
OK.
So hopefully that makes sense.
And let's actually go inside the main activity that Java here and now I want to actually output some
text to the screen.
OK.
So here I just need to create an object from the cat class.
So first of all I just need to refer to the name of the class and the name of my object is Chatz one.
And then I put an assignment operator here and then I actually put this key word here Neal chat's as
you can see here and it inside the here.
I need to actually passing some values as you can see here.
String name string color.
I'm out of speed in amount of power.
Number of legs and this boolean variable can hunt other animals.
OK.
So we actually create on an object for the chad class the constructor of these class is going to be
called.
OK so this is the constructor.
So we need to actually pass those values here.
Here inside Apprentice's.
OK.
So first of all I need to actually pass a value of type string.
As you can see here inside the cathe class the first argument is of types 3 and.
And the name of this argument is name.
So we need to actually give a name to this chat object.
So I just need to put in two double calls here and then inside the table Cotes.
I can't actually just type in a name.
For example my chat the name of my cat is cat object is my cat comma and the value for the second argument
must be again as three in value as you can see inside the class the data type of this argument is our
strength and the name of this argument is color.
So we need to actually specify the color of an object.
So let's go back and say the main activity that Java here.
I just need to put into double quotes and for example the color of my cat is white and then I put a
comma here and then I need to actually specify my first argument here.
So let's go back inside the cat the java file.
As you can see my first argument is of type integer and the name of my argument is amount of speed.
So we need to actually pass a value of like integer.
So for example the speed of my chat is 40.
OK.
And then I need to actually put a comma here.
So here I need to actually specify the fourth argument for my constructor here.
So let's go back and say the cat the java file as you can see our forth argument is of type integer
and the name of my argument is.
Amount of power.
So I need to specify the amount of power of my cat object.
For example 40 karma.
And here we need to actually specify the fefe argument.
So let's go back and say they kept the chatter of a fight here and we need to actually specify the number
of legs for our chat object.
The number of legs of my cat object is four comma.
And let's actually go back in say the cat fight again.
And here we need to actually specify our last argument.
OK.
Which is of type Boolean and the name of our argument is can hunt other animals.
So let's go back and say the main activity that over here for example troll or cat object can hunt other
animals.
OK.
As you can see here I want to actually output these values to the screen.
So let's go back inside to catch up the job fight here.
As you can see here we didn't actually overwrite the two strange Mefford that that is inside the Object
class.
OK so as you can see here this cat class implicitly inherits from the Object class.
OK.
So if you want to actually explicitly say that this cathe class inherits from the Object class I just
need to type in here extents object.
OK but if we don't put these two words here are Kathe class is going to implicitly inherit from the
Object class.
OK.
This cat class inherits all of the features and behaviors that are inside the Object class.
So inside the main activity that Java here if you want to actually call that to string method let's
see what happens.
T XTi chat that said text chat's one dot to.
As you can see here inside the Chatta class.
We didn't.
All right.
That was Thring method here.
OK.
We are just calling our Smurfette to a stream that is inside the object class.
OK.
So let's actually run our project and see what happens.
So as you can see here it only put this value here.
OK the name of our package at sign and this number OK.
So let's actually go back inside our chat class and let's actually find the string method that is inside
the Object class.
OK.
So let's actually put this extents object here and then hold the command key on your keyboard and then
click on this object class.
Here if you are using of those machine you need to actually hold the control key on your keyboard and
then click on that object class here instead of math class.
OK.
So as you can see here this is our object class.
So in order to find the string method I just need to actually press on command key plus the f he on
my keyboard.
If you are using a Windows machine you need to actually press on control key plus the key on your keyboard.
And here I can search for it for the method names or for there are two other keyboards.
OK the name of my method is to streambed.
So as you can see here these are two string Meffert OK return gets class.
So let's actually see what's in the emulator.
So this is our emulator OK.
Return get class that get named.
As you can see here this is the name of the package.
Our project this chat here is the name of our class.
OK so return gueth class that get name it returns.
Are this a value here.
The name of our class at sign integer to Hexe.
Strange as you can see here this code here is the result of these quotes here.
OK.
Integer the two hex string hash code.
Ok so you don't need to know whether these are actually values.
I just wanted to show you that this is the default implementation of these Smurfette.
So in order to actually output these values these values that you specified for this chat object to
the screen we need to actually overwrite that to a string method here.
So I just need to type in here to stream as you can see the autocomplete feature of the Android studio
helps us to find that Meffert here.
Okay.
And then I just need to press on return key on my keyboard.
Or if you are using a Windows machine you need to actually press on Enter key on your keyboard.
So as you can see here this is arm twisting method and as you can see it is outside of a right.
Q What here means that we are all the radio.
Or redefining our Meffert that is inside the superclass.