Hire everyone in this theater early on I'm going to talk about inheritance in Java.
So first of all let me point out that inheritance is one of the features of object oriented programming.
Inheritance allows a class to use the properties and methods of another class.
OK.
In other words that the right class inherits this Tait's and behaviors from the base class.
So for example we have two classes in our project and we can actually specify the base class and the
D-Rays class and the deprived class can inherit the states and behaviors from the base class which I'll
talk more about later.
OK.
That 0 2 class is also called subclass and the base class is also known as superclass.
OK.
So the desired class can add its own additional variables and Misfit's is additional valuable and Milford's
differentiates the derived class from the base class.
OK a simple class can have any number of subclasses but a subclass can have only one superclass.
OK so this is because Java does not support multiple inheritance.
OK this superclass and subclass have is a relationship between them.
So now like let me actually show you a real example OK.
OK so now let's actually consider a superclass called a shape.
OK.
Different shapes have different features and properties.
However are few of them are common to all.
For example the color of the shape the size of the shape or other properties.
OK.
Hence as a result we can create a class called Shape with states and actions that are common to all
shapes.
OK.
So as you can see here we've got two dimensional shapes and for dimensional shapes.
OK.
The circle shape is a subclass of the two dimensional shape.
The square shape is the subclass of two dimensional shape.
And this triangle shape is a subclass of these two diminished two dimensional shape.
Class OK.
And on the other hand we've got three dimensional shapes.
The sphere class is the subclass of three dimensional shape.
The Cube class is a subclass of freedom and Shannons shape.
And the pyramid class is the subclass of freedom engine shape.
OK.
As you can see here this two dimensional shape class inherits all the features and behaviors of this
Shape class and this class can have its own behaviors or methods.
OK these two dimensional shape class and down the hierarchy.
This circle class inherits all the features and behaviors of these two dimensional shape class and this
class.
This circle class can have its own merits and features specific to the Circle class Square class.
Again it inherits all the features and behaviors of the two dimensional shape class and it can have
its own features and behaviors specific to this square class.
Again the triangular class inherits all the features and behaviors of the two dimensional shape class.
But it can have its own features and behaviors specific to this triangular class.
And again this Fredy mention on Shape class inherits all the features and behaviors of the Shape class
but it can have its own features and behaviors specific to that freedom in general shape glass and down
the hierarchy as you can see this sphere class inherits all the features and behaviors of the three
dimensional shape class.
But it can have its own features and behaviors specific to the US sphere class and this new class inherits
all the features and behaviors of the three dimensional shape class but it can have its own features
and behaviors specific to this cube class.
And it's the same story for this pyramid class.
OK.
But for example this triangular class cannot inherit the features or behaviors of these three dimensional
shape class because it doesn't inherit features or behaviors of this class.
OK.
The triangle class can only inherit the features or behaviors of the two dimensional shape class or
it can inherit the features or behaviors of the Shape class.
OK.
So here as you can see the two dimensional shape class is a shape.
OK.
And this circle class is a two dimensional shape.
This square class is a two dimensional shape and this triangle class is actually a two dimensional shape.
So as a result.
So as you can see there is a relationship between these classes that inherit from each other.
And again it's the same story for this freedom in a class.
So is freedom freedom and you know Shape class is a shape.
OK.
There is a relationship between these two classes because this freedom mention on the Shape class actually
inherits behaviors or features of the Shape class.
OK.
And this sphere class actually is a three dimensional shape because it inherits the behaviors or features
of this freedom emotional shape class.
And we've got this our class actually this queue class is our freedom engine and shape and as a result
it is a shape.
OK.
Because this cube class actually inherits that behaviors or features of these three dimensional shape
class and Frady mention or Shape class inherits the behaviors and features of the Shape class.
So as a result the cube class is a shape.
OK.
And we've got this pyramid class this PM class is actually a free dimensional shape and as a result
it is a shape.
OK.
As you can see that is it is a relationship between these classes here.
OK.
So hopefully that makes sense.
So now let me actually show you another example.
So as you can see here we've got this Animal class here and this animal class is the base class.
OK.
So this chat class actually inherits all the features and behaviors of this Animal class.
OK.
So as a result this tath class is an animal.
OK.
And we've got this leopard class this leopard class actually inherits all the behaviors and features
of this cat class and this cat class inherits all the all the features and behaviors of this Animal
class.
So as a result this leper's class is a cat and it is also an animal.
OK.
Because this leopard class inherits all the features of this cat class.
And so as a result it is a cat and it is also an animal.
So hopefully that makes sense.
So now let's actually go inside the anthrax and create are actually our fourth Android application.
OK.
Now let's actually open the Android studio and then click on start a new Android studio project.
And then we need to actually specify a name for an application name.
So just type in here before.
And then here we need to actually specify a name for an application name app for and here specifically
the company domain.
And here you can specify the package name by clicking on the edit here and then you can actually specify
the project location here.
OK.
And then click on next.
So here make sure that you choose the API 16 Android what wanted it been for your minimum and then click
on next.
And here choose the blank activity and then click next.
And here this is the this is the activity name main activity you can you can change this name if you
want.
This is our lay out name as you can see activity underline main.
And this is the title main activity for our application.
As you can see and this is the manual resource name.
So I recommend that you don't change these names here and then click on finish.
So as you can see here it can actually create our Android application for us.
So first it's going to actually configure and set up the application.
OK.
Now as you can see our Android project is created.
So as you can see here it's now showing us that error again.
So we need to click on these cradle squits here and then click on this build that cradle here and then
change change this number to number one and change this number change this number to number one.
OK.
So click on this scene now here and then let's go back inside.
Inside the content underline mean that excitement as you can see now the error is gone.
OK.
So let's go inside the main activity that job right here.
And as you can see let's actually delete these lines of code here.
I'll talk more about these options.
But for now I don't want to actually create many options in our application and here really these floating
action Potten here.
So let's actually go back inside the press folder here.
And then double click on this layout folder here and then double click on this activity underline mean
that Semmel OK.
So click on this text tab here and then delete these lines of code here which is related to the float
float in action button here.
OK.
Now let's actually close this window here.
This activity underline made that example.
So just click on this X here.
As you can see.
So as you can see this is our main active main activity that job here.