And let's actually go inside this main activity that you have a fight here and now let's actually create
an object from this vehicle class and the name of this vehicle can be my vehicle and then I put in an
assignment operator new vehicle.
OK.
So here we need to actually passing some values.
First of all I need to actually passing the value of the speed so valuable the value of the speed of
this my vehicle object.
For example 45 karma has braking system.
True karma and number of wheels for example.
Fourth.
OK.
And then I put in a semi-colon at the end of my statement.
Now I want to actually output these values to the screen.
So first of all we need to actually create Smurfette in order to allow us to put these values to the
screen.
So let's actually overwrite the twisting method that you actually to inherit from the Object class.
OK.
So I just need to refer to the name of this twittering Merfeld and here as you can see it says return's
superb that was 3M.
So I don't want to actually execute the implementations that are inside the twisting Meffert inside
the Object class.
OK.
This super refers to the object class.
So I don't want to actually execute those implementations that are inside these two or three Meffert
inside the inside the object class.
OK.
So let's actually delete this line of code here.
So here inside the Smurfette I can just type in return.
Strange that format and first of all I need to actually specify the formatting instructions of this
object.
OK.
Percent.
As comma.
And now I need to actually specify the speed of instance variable.
So percent the.
And again percent as comma.
Now I want to actually specify the has braking system in sense valuable.
So percent B and again percent as comma.
And now we want to actually specify the number of Veals instance variable.
So percent D.
And again we have another instance variable right speed which is of type integer.
So here I can just type in percent as comma percent D.
OK.
So now I want to actually refer to these instance variables.
So remember that I said in this earlier in this tutorial always use getters and setters in order to
mislead manipulate the value of your instance variables even if you are using them in your own class.
OK so now I can actually access these instance variables by using these get here as Meffert.
OK.
So here I can actually put in some arguments in order to relate those arguments to these talking.
OK.
So for the first token I need to actually put in a string value.
So I just put it into double quotes here and again just typing speed ok karma.
And now I need to actually put up an argument of type integer so I can just refer to the name of this
good speed method.
And again I need to actually put in a string value here has braking system so I can just type in up
can break and come up and here I need to actually putting in an argument of type Boolean.
So I can just put in.
So I can't just refer to the name of that gets has breaking system comma.
Let's actually create a new line here and now I need to actually again putting a value of type string.
Ok so I just put it into double quotes and then inside the double quotes I can't just put in a value
of type string.
Ok so a number of violists number of wheels.
OK come on.
And now I can actually refer to the name of this get number of veal Smurfit OK good number of years
comma.
And again we have these percent as talking here.
So I can't just put into double quotes and then in a set of double quotes I can just refer a value of
type string.
So for this right speed instance variable.
So I can just type in right speed.
Ok comma gets right speed.
And then I put in a semi-colon at the end of this method.
OK.
So hopefully that makes sense.
And let's actually go back inside this main activity that you are here.
First we need to actually create some objects from the text your class so I can just type in here text
you the name of this text is TXI the vehicle.
OK.
And then I put an assignment operator here and then I need to actually cast this object to a text you
find view by ID or that Id dot the X the vehicle.
OK.
And then I need to put in a semi-colon at the end of my statement.
So now I can actually refer to the name of the vehicle object that said text.
And that inside Apprentice's I can just refer to the name of this mine my vehicle object that has three.
OK.
So hopefully that makes sense.
And now let's actually run our project and see what happens.
So as you can see here these are the values that are actually outputted to the screen or shape.
So speed 45 as you can see here and can break through.
OK.
Number Aviles four and right speed zero.
And now you may wonder why the value of this right speed variable is zero because we actually created
an instant Smurfette inside this vehicle class here.
OK.
Right.
But we didn't actually call the Smurfette on our object.
OK.
On our vehicle object.
So before we actually want to output these values to the screen before this line of code as you can
see here we can actually call that Smurfette on this vehicle object.
So first I need to actually first with the name of this object.
That's right.
OK.
And now it's going to actually assign some value to the right speed instance variable.
OK.
So let's actually run our project and see what happens.
So as you can see here now the value of this road speed variable is one hundred and eighty.
OK.
So hopefully that makes sense.
Now let's actually go ahead and work on this car class.
OK.
So now for example suppose that we don't have any specific characteristics that are going to be related
only to this car class.
OK.
So in this case we can actually create only a constructor for this car class.
So first I need to actually specify the access modifier of this constructor and then I need to actually
refer to the name of this class car.
And now as you can see inside the prentices we can actually specify some arguments.
So now let's actually specify that this car class actually can inherit all of the features and behaviors
that are inside this vehicle class.
OK.
So here I can just type in extends vehicle.
OK.
So now as you can see here in this our construct that is now showing us an error.
OK.
So we need to actually initialize the constructor that is inside the superclass which is this vehicle
OK.
So let's actually go inside this vehicle class and as you can see here we've got this constructor here
and we need to actually initialize this kind of structure inside this car class.
OK.
So we need to actually passing a value for the speed of value for the HAs braking system and for an
a value for a number of wheels of that specific vehicle or car.
OK.
So inside this car class I can actually specify those arguments in it and the name of this argument
is speed.
Karma Boullion has braking system.
Ok on.
End number of wheels.
OK.
So now I can actually initialize the constructor of the superclass by just passing these values.
Speed camera has braking system.
Come on.
Number of wheels.
OK.
And as you can see here we don't have any instance variable related to this car class.
OK.
I can actually overwrite the two string method that we are actually inheriting from this vehicle class
so I can just take in here too strange.
And then it can actually execute the implementations that are inside these two string Mefford inside
this vehicle class.
OK.
So super refers to this vehicle class that was three in the first with this method.
And then it can actually go inside the Smurfette and then it's gonna execute this line of code here.
OK.
So hopefully that makes sense and then it's actually going inside this main activity that over here
and now I can actually create an object from this car class.
OK.
And the name of my car object is my car and the puts an assignment operator here new caught.
OK.