And let's actually create an object from disparate class inside this main activity that you will fight
here.
Well OK here let's actually create an object from this bird class.
So first I need to refer to the name of this birth class my birth and I put an assignment operator here.
Neil Baird and now I need to actually passing somebody else first I need to specify the name of my object.
For example my birth and say Can I need to actually specify the color of my bird.
For example white comma and now I need to actually specify the amount of speed of my bird for example
600 Kamaal and now I need to actually specify the amount of power of my bed.
For example 20 comma.
And now I need to actually specify that whether my bird can fly or not.
OK so true.
Comma.
And now I need to specify the number of blinks of my birth to.
And I need to actually put in a semi-colon at the end of my statement.
So now I can just type in here anti-X the beard that said text and in inside the prentices I can just
refers to the name of this birth object my birth that's too strange.
OK.
So hopefully that makes sense.
And let's actually run our project and see what happens because now I want to actually to show you another
important point about our XML files.
OK.
Now as you can see our plunged on this emulator here but we cannot see the values that are related to
this.
My first object here.
OK.
So what's going on here.
Now we need to actually change some attributes that are related to the components of this screen here.
OK.
So let's actually go inside this content underline means that I mean here and now I want to actually
talk about the weight attributes which is of very important attributes in exemplifies.
OK.
So let's actually select all of these components here.
Other insight is exemplified here.
All of these takes the view of components and let's actually find derivative weight attribute here.
OK so now let's actually open the calculator.
And now let's actually divide number one by five.
OK.
One divided by five zero point two.
OK.
So let's actually put this value here.
Zero point two.
OK so now let's actually reduce the margin of these components here.
Inside the screen here for example 5.
And let's actually reduce the padding of these takes three components here.
And let's actually to change this value to 5.
OK.
And now let's actually go on our project and see what happens.
So as you can see here now are these values are outputted to the screen here.
OK the values that are related to the birth object is outputted here.
A name might birth color white speed 600 power 20 fly true and number of beings.
OK so you may wonder that what did you do here in this exemplified in order to show these actualities
values to the screen.
Let's actually talk a little bit about the vate attributes.
That is a very important attribute in exemplifies.
OK.
And you need to actually use this attribute in all of your projects.
OK.
So let's actually doubleclick on this content.
Underline that it's a man.
So now as you can see we've got this vate attributes here.
OK.
I first.
Divided.
Number one.
So here I actually divide it.
Number one by number five.
OK.
So why did they do that.
Because as you can see here.
OK.
So now as you can see here I assumed the height of the screen is 1.
OK.
And I wanted to actually put five components inside this screen here.
OK.
So I decided to actually divide number 1 which is the height of the screen by number 5 and the value
is 0.2.
OK.
So as you can see here we've got five takes three balls here.
OK.
And I want to actually put these five takes to use here inside this screen here.
And because we are actually using a linear layout there is vertical.
It's going to actually put these of five components here vertically.
And if you actually assume that the height of this screen is 100.
And let's actually do that.
For example we are now assuming that the height of this screen is 100.
OK.
And if you want to actually put five components inside the screen we need to actually divide this 100
by number five.
OK.
Because we've got five components here.
OK.
And the value is number 20.
So let's actually put the number twenty four The vate of these components here.
OK.
So as you can see here I put the number twenty for the vate attributes of these card takes three components
as you can see here in this screen.
OK.
And let's actually go on our project and see what happens.
So as you can see here now it's going to actually run our project.
And now you will see that it doesn't make any difference now because as you can see here I assumed that
the height of our screen is is 100.
OK.
And I actually divided that 100 by number five.
And the result was 20 and I actually put.
And I actually assigned number 20 to the lay out rate of these takes the objects here of these takes
you.
OK.
And now as you can see it doesn't make any difference if you assume the height of the screen actually
assume the value of the height of the screen number one.
Or if you assume the value of the height of the screen is 100.
OK.
It doesn't make any difference.
OK.
And as you can see it pood These are five components here.
Inside this screen here.
OK.
And I actually reduced the number of markings and the number of padding of these components a little
bit.
OK.
So as you can see here now all of these attributes are inside the screen here.
OK.
So hopefully that makes sense.
So it lay out.
Wait we can actually specify a size ratio between multiple views.
OK.
So as you can see here we've got multiple takes to use here.
OK.
And I want Actually every each of these takes two views to actually take one fifth of the layout height.
OK.
So first I actually assumed that the layout height of this screen is one hundred.
And then I divided that 100 by number five.
OK OK because I have five.
I'll text you here.
OK.
And the result was number 20 and then I assigned numbers 20 to this lay out eight.
OK.
So I gave a lay out weight of 20 to each of these picks to use here.
OK.
Each of these takes here actually to take von fefe of the layout height.
OK.
So that's why we can't actually see all of these values here.
OK because each of these takes views actually take one fifth of the screen.
OK.
So hopefully that makes sense.
And now I want to actually talk about casting objects in Java.
OK so now that you actually know all about inheritance in Java are you going to actually talk about
caste themed objects.
OK.
So as you can see here we've got these five text view objects here.
OK.
And let's actually hold the comment key and then click on the text you hear if you are using a Windows
machine you need to actually hold the control key on your keyboard and then click on takes to you.
OK.
So as you can see here this is our text view class here.
OK.
And this text your class is actually inheriting all of the features and behaviors that are inside this
view class.
OK.
So we can actually say that this takes the class ease of view.
OK.
And here inside is main activity that Java right here as you can see because you are actually referring
to a component inside the screen as you can see.
We've got these components here.
OK.
Because we are actually referring to those components we need to specify that we are actually referring
to our text view component.
OK.
So here we are truly casting that object to a text art object.
Otherwise the compiler may finish that we are actually referring to our view object.
OK.
But this is our text view.
OK.
So that's why if you actually cast at this object to our text you object.
OK.
So this is very important.
As you can see here inside this text your class this text is inheriting all of the features and behaviors
of this class.
And this means that this takes through ease of view.
OK.
So Vieni to actually cast this object to a text view in order to let the compiler know that we are actually
referring to our text view object.
OK.
But I think that's enough for now about our casting objects.
OK.
Later in this course more familiar with casting objects in Java.
But for now it's enough.
And our Forth Android application is finished.
OK.
And we have successfully built our Forth Android application.
And if you have any questions about inheritance in Java please post the discussion in the course and
then I'll do my best to answer your questions.
And thank you very much for watching and I'll see you in the next tutorial.