Hi everyone.
So now in this story we going to go ahead and we're going to create the model of this application.
The model is going to be that datasource that is going to actually give us that date of this app so
it is very important to create the data first.
Muller first so let's open the ad with you here.
Let's open this app folder and open this job folder here we have this first package just open it right
click on this package here are new.
Let's create another package.
Is going to be model and then click on OK.
So now we have another package inside this package called Model Right-Click on this model here.
Let's create a new class new job class the name of this class is going to be martial arts martial arts.
Right.
And here just don't change anything and just click on OK.
So we have this martial art class here.
Let's double click on this marshal at the top of file in order to make this area right there.
So now let's specify some instance variables for this martial arts class.
The first one is going to be of type actually streambed.
So I can't say private's strange.
And the first instance variable is going to be martial arts any martial art any semicolon.
Private.
Let's create another thing since Friday he or and it is going to be that integer and the name of this
instance variable is going to be martial art.
Price martial arts price semi-colon.
And the final instance.
But it's going to be off against streambed and it is going to be the color so private's strange martial
arts culture martial arts.
Semi-colon.
So now let's create a constructor for this martial art class.
But before we actually create a constructor for this martial art class it's very important because we
want to save our martial art objects to eschew light.
It is very important that we specify an ID for each martial art.
OK so let's create first let's create another instance variable for the ID.
So in private and martial arts I-T martial arts ID semicolon.
So let's create a constructed for this martial art class.
Now so first we need to specify the access modifier of this constructor which is going to be public
and the name of the constructor must be the same as the name of this class martial art.
And just put a pair of practice year open and close this constructed by using these curly braces here.
So let's specify some parameters for this martial art constructor.
The first premise is going to be of type integer and the name is going to be the comma.
The second parameter is going to be of types three and the name is going to be a martial arts name so
let's name it actually as a name so that the name of these primates are isn't that good.
It's not going to be the same as the name of this instance valuable.
So the first argument or the first parameter actually is going to be that the price.
So again it is going to be half that integer price come on and the final prime is of types 3 and then
Aimee's color.
Right.
Let's go inside this constructor and let's initialize our instance valuables inside this constructor.
So we have this marshal or Id like assignment operator ID semicolon So here I am assigning these ID
to this motional ID here.
And the second instance valuable is martial arts name assignment operator name semicon that I am referring
to is name a parameter right this name argument actually and the first instance variable is going to
be a martial art price assignment operator price semi-colon and the final instance variable is Marshal
not color marshal or color assignment operator color semicolon.
So now its time to create some actually setters and getters for our instance Spidy events.
So after the ending curly brace of this constructor here inside this martial art class I'm going to
write here inside this empty area and click on generate and here click on actually the first.
Let's create some get here.
So just click on get here.
Select all these.
Instance variables here.
OK just hold down the shift key on your keyboard and then select all these instance variables and just
click on OK.
So now you can see that these guitars are created for us automatically by Android studio for instance
variables.
Right now let's create actually setters for instance variables after getting curly braces of the Smurfit
get Marshall of color and before the eddying curly brace of this martial art class inside this empty
area right click here just click on generate and click on setter select all this instance variables
here and just click on OK.
So now you can see that the setters for all are instance variables are actually created right here you
can see it has set match that Id set modulars names that marginata price and set a lot of color.
So now that we have this sitars we can use these setters in order to initialize our instance variables
instead of directly referring to our instance variables here.
I can use this settler's that I created here.
Remember I told you in the Java section of the course that it's not recommended to directly access your
instance variables even inside your class.
Even inside this martial arts class.
So let's delete these quotes here inside the constructor.
And now I can't see cits martial art ID.
And here I can pass ID here as an argument to dismiss it or I can say certain martial arts NE and here
I can pass name here said Martial Arts.
Actually price and I can't pass price here.
And finally said Martial Art color and I can't pass the color here right.
That's it.
So this is our martial arts class in the next story and we're going to actually create a school like
class.
So thank you very much for watching.
And I said and I said Tauriel.