So because we declare this sport class as you can see here as an abstract class OK.
Now you can see that the compiler doesn't show us any error.
So now I want to actually implement the error is gone.
OK.
And this class this sport class actually implements this life insurance interface.
OK.
So here let's actually create some getters and setters for our instance variables here.
OK.
So so instead of this class just basically here.
OK.
And then actually can generate and then we can get here and setter and the list actually select all
of these.
Instance variables and then click on OK.
So now as you can see the ITD Android.
So you are the ID actually it.
These are good heroes and sitters are automatically for us.
Kate gets Name City Name get rules set rules get uniform set uniform OK good speed required set speed
requires gets power required and set the power required.
OK so now I want to actually are.
All right the twist thing is that these are sport class actually implicitly inherits from the Object
class.
Ok so here you can see I can just put in extends object.
Here I am actually explicitly inheriting all of the features and behaviors that are inside of the Object
class and this class also implements this life insurance interface as you can see here.
OK so now let's actually overwrite the two string Meffert that is inside of the Object class.
Ok so I can just put it here.
So here as you can see I pasted these lines of code here at St..
Right public.
Strange too strange.
OK.
And this move is actually as good as you can't see returns a string value.
So here inside of the sniffer as you can see I'm saying that return string data format.
And he had set up these double codes.
I am actually specifying the format of my string value.
OK.
Per Cent.
So here this token person this is actually referring to this name here.
OK this string value call in person s gets name or key person in a newline character and other person.
So these rules here as you can see is for just a token as you can see here call it space person as sort
this person as is for this gets rules OK and a person in a newline character and person s as you can
see here is for this uniform.
OK.
Kallen space.
We have another person as here gets uniform.
OK a person as a person in as you can see here.
This is a new character.
We have another person is here.
So this person is Fortius spit required here.
Co-lead Space Person D.
Ok so this person is for this gets speed required.
Ok person has a new line character person s and this person is for this power requires.
And as you can see here Colan space person.
So this person is what this gets power required.
OK.
So hopefully death makes sense.
And now let's actually go inside of this box in class.
OK.
Now I want to actually.
So as you know boxing is actually a sport.
OK.
So there is actually an is a relationship between the boxing class and this sport class.
So here again to say it extends sport.
So now as you can see the compiler is actually complaining.
And let's actually hover on a mouse pointer over the area and see what's the error.
Plus boxing must either be declared abstract OK or implement abstract method.
Evaluate cost of insurance.
So as you know boxing is not an abstract concept so we need to actually implement the cost of insurance
a method that is actually declared inside of these life insurance interface.
So because we are actually inheriting all of the features and behaviors that it inside of this support
class and this support class actually implements this life insurance interface here inside of this boxing
class we need to actually overwrite the abstract method that is inside of this life insurance interface
as you can see here.
OK.
So hopefully that makes sense now necessarily actually putting some more lines of code here.
OK.
Now inside of this box in class that's actually declare some instance variables.
OK.
So here as you can see I declare these these instance variables.
OK.
Int punching power required int punching speed required.
And ain't a cost of insurance.
So let's actually declare these instance variables as private.
OK.
Private and hear private and private.
OK.
So now they essentially create a constructor for these in class.
So inside of this box in class I'm going to actually pasting this constructor here and then I'm going
to explain to you what's going on here.
So as you can see here we have a constructor here Puplick public boxing.
And here as you can see this box image actually does boxing constructor actually accepts some arguments.
OK.
String name string rules string uniform and speed required into power required.
And as you can see here.
Punching power required and punching sweetly quiet.
And it cost of insurance and inside that is constructive.
Because I am actually inheriting all of the features and behaviors that are inside of this sports class.
We need to initialize the constructor of the superclass.
So super name rules uniform.
Spaeth required and power required.
OK.
And then we can actually instantiate our own instance variables.
OK.
This does punching power required assignments operator punching power required.
OK.
Does that punching Spitze required as you can see here I am referring to this instance variable assignment
operator punching required.
OK.
And does that cost that insurance assignment operator.
Cost of insurance.
OK.
So hopefully that makes sense.
Now let's actually create a Getaround the Center for these two instance variables are key punching power
required and punching speeds required.
OK.
We don't need to actually create or get her the city for this cluster insurance instance variable.
OK.
So here again just slightly and say that this class generate and get here and sit here and here for
these two instance variables punching power required and this instance valuable punching Kuspit require
you selectees instance variables and then click on OK.
So as you can see the ID actually automatically generated these instance variables for us.
These are these getters and setters for us.
Okay.
And now let's actually overwrite the Evaluate cost of insurance Smurfit that is inside of this life
insurance interface.
So here because of your inheriting all of the features and behaviors that are inside of this sport class.
Okay.
So let's to go inside of this sort of last year and this sports class actually implements life insurance
interface this boxing class must actually provide an implementation for these for there are costs of
insurance Smurfette that is in say that this life insurance interface.
So inside of this boxing class I as I say pain evaluates a cost of insurance Mefford as you can see
here and here we are actually operating disparate public double evaluate cost of insurance.
So let's actually delete this implementation here and now we can i should be putting our own implementations
inside of this method.
OK.
So here I can just type in return.
Cost of insurance.
Semicolon.
OK.
So inside of this Meffert I'm just returning the value of this a custom insurance instance variable
that I like that I actually created inside of this box in class.
OK.
And here after the Smurfit after the Indian curly brace up this my fit and inside of this boxing class
let's actually override the twisting method that we actually inherited from the superclass.
So what is the superclass the superclass is the sport class.
OK.
And we can actually inherit this method.
OK.
So inside of this boxing class here again just typing to a stranger.
And let's actually delete this line of code here.
And let's actually put in our own implementations.
That is actually specific only to the boxing class here.
OK so now I'm going to actually pasting some lines of code 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 the implementation that we actually put in here.
OK return string format here and inside double quotes.
I am actually specifying the format of my string value so person s.
So this person as here had this token is actually for this super string here.
OK.
So super eject.
I should be the first to the superclass.
So the superclass is actually this sport class.
OK.
And inside of this sport class we have these two strings left.
OK.
So if this boxing class as you can see he actually called these are two string Meffert on this super.
OK.
So here as you can see we are actually going to actually execute these lines of code that are actually
inside of these two string Mefford here as you can see.
And then here it's going to return these values.
Ok for example gets name cathedral's gets you any form gets speed required and gets our power required.
OK.