Hire everyone in this theater you are really going to go ahead and create another Android application.
So just click on this start in your Android studio project here.
And for the application name just type in your app 29 and then click on Next choose API 16 Android 4.1
jelly been for minimum STK click on next.
And then choose Blanc's activity next and then click on finish.
OK.
Now let's actually select these hellova or text view here and then press on delete key on your keyboard
and then double click on this LS folder here.
Lay out activity on the line.
Make that example.
And then here selectees faluting action button here and then press on delete key on your keyboard.
OK so now let's actually go back and say this content underly mean that exemption.
And then here we can actually design the user interface of our application.
OK.
Now let's actually select this linearly elsewheres call here and put it at the center of this relatively
out here.
OK.
And then let's actually select these are vertical scroll view here and put it at the center of this
linearly vertical and then lets actually select is linearly onto a circle and put it inside this scroll
view here.
OK.
And then now let's actually select this large text view and put it inside this linearly Ellsworth's
the call that is inside of this scroll view here.
OK.
And double click on it deletes the text of the stakes and the ID just typing here takes the polymorphism.
And now let's actually go back inside this main activity that are filed here and then let's actually
select these lines of code that are actually related to the Options menu.
OK.
And then select these lines of code that are related to the floating action button and then delete them.
So now we can actually put in our own code here.
Now let's actually create some Java classes in our project.
So just click on File New and then click on Java class.
So for the first class just type in here sport OK and then click on OK.
Let's actually create another class file new Java class and then the name of this class is boxing.
OK.
And let's actually create another class file new double class and the name of this class is kickboxing.
Kick boxing.
OK.
Now let's actually create another job of classified new and Jobbik less.
So for the name of this class is student.
OK.
Now let's actually create an interface new file new Ok Doba class and the name and here for the kind
to choose interface.
OK.
And for the name of this interface just type in here life insurance
OK and then click on OK.
So now I want to talk about interface in Java so interface is actually like your class in Java and it
is actually a reference type interface is actually a clip a collection of abstract methods.
OK.
So we can have a collection of abstract methods in interface.
OK.
And a class that implements an interface for example Maxime's when it wants to implement and in fact
an interface to implements or life insurance as you can see life insurance is actually an interface.
Ok so a class that implements an interface thereby inheriting the abstract methods that are actually
inside of this life insurance.
So as you can see here we don't have any abstract if it's inside of these life insurance interface but
we can have abstract benefits inside of these life insurance interface.
OK.
And along with Misfit's along with abstract methods an interface may also contain constants default
methods and static methods and or nested types.
OK I'll talk more about them later.
OK.
But for now remember that in giove up you can only inherit from one class directly.
OK so in Java we can only inherit all classes can only inherit from one class.
OK.
And they can implement our classes can implement as many interfaces as they want.
OK.
So let's actually create some abstract methods inside of these interface.
OK.
So by default of when we actually create an effect in this interface on if it's actually abstract.
OK so now let's actually create an abstract method inside of these life insurance interface.
So just open here.
Double OK.
And for the name of this abstract method just type in here.
Evaluate OK.
Cost of insurance okay.
And then put a pair of Prentice's here and then put a semicolon at the end of your left.
OK.
So as you know methods in interface cannot have body OK a class that actually implements this interface
must actually provide that body for this interface so as you can see here in say that this box in class
as against this class actually implements this interface.
So we need to actually provide a body to override that Meffert evaluate cost of insurance.
That is actually declared it life insurance interface as you can see.
We need to actually implement that method here inside of this box in class and then provide a body for
that.
OK.
So now first of all let's actually go inside of these sports.
The job of right here and inside of this class is actually putting that letter actually put in some
more lines of code here.
OK.
And first of all let me tell you that this Porth class is actually an abstract class.
OK.
So if I ask you that please give me a sport.
It doesn't make sense.
You may ask what kind of sport do you want.
OK so you mean I said you may want a boxing sport kickboxing sport or actually another kind of sport
for example Judo.
OK sport by itself is actually abstract.
So we need to declare this concept really to actually declare this class as an abstract class.
OK.
So hopefully that makes sense.
So first of all inside of this sport class this actually declared some instance variables here.
OK.
So as you can see here I have an instance variable private string name.
OK.
And I have another instance variable private and the type of this instance variable is strange and the
name of this instance variable is OK.
For example the rules of this sport.
OK.
Private string uniform.
Int speed required ain't Pavarotti's quite yet.
OK so we can actually declare this instance variables as private here.
OK private and I can actually declare this instance variable as private too.
OK so now let's actually create a constructor for this sports class.
So now I'm gonna actually pasting this constructor here and then I'm going to actually explain to you
what's going on here OK.
So as you can see here this is my constructor for this sport class.
OK.
And as you can see public the name of the constructor must be the same as the name of the class.
OK.
And this constructor actually accepts some arguments.
OK.
String name string rules string uniform ain't required in power required.
And as you can see here I am I try to instantiate in my instance variables that I actually declared
inside of this sport class.
So this does name actually refers to this name here.
Assignment operator name the start rules assignments operator rules.
OK so these rules actually refers to these local variable here.
This argument rules the start unifor assignment operator unifor.
OK the start speed required assignments operator speed required does that power required assignment
operator power required.
OK so here let me tell you that a support class this is class actually can implement implements this
life insurance interface ok.
Life insurance.
OK.
So now that we actually specify that this sport class actually implements this life insurance interface
here now we can actually implement the method that is inside of these life insurance class here.
OK.
This evaluate cost of insurance.
So let's let's actually go back and say the spikes in much of a fight here and then it's actually delete
this piece of quote here.
OK.
And now let's actually go back inside this sports class as you can see here because our class is an
abstract class.
OK.
And here we are actually implementing this life into a life insurance interface.
We can actually or the compiler doesn't show us any error.
Ok but if this class wasn't an abstract class let's actually delete this abstract keyword here.
Now as you can see the compiler is actually showing us an error and it says class support must either
be absolute must be either be declared abstract or implement abstract method.
Evaluate cost of insurance in life insurance interface.
Ok.