1
00:00:00,330 --> 00:00:01,280
Hi everyone.

2
00:00:01,480 --> 00:00:07,700
So now in this story we going to go ahead and we're going to create the model of this application.

3
00:00:07,740 --> 00:00:13,200
The model is going to be that datasource that is going to actually give us that date of this app so

4
00:00:13,200 --> 00:00:16,430
it is very important to create the data first.

5
00:00:16,520 --> 00:00:19,670
Muller first so let's open the ad with you here.

6
00:00:19,680 --> 00:00:26,460
Let's open this app folder and open this job folder here we have this first package just open it right

7
00:00:26,460 --> 00:00:28,140
click on this package here are new.

8
00:00:28,260 --> 00:00:29,960
Let's create another package.

9
00:00:30,030 --> 00:00:33,390
Is going to be model and then click on OK.

10
00:00:33,760 --> 00:00:39,020
So now we have another package inside this package called Model Right-Click on this model here.

11
00:00:39,190 --> 00:00:47,280
Let's create a new class new job class the name of this class is going to be martial arts martial arts.

12
00:00:48,130 --> 00:00:48,780
Right.

13
00:00:49,150 --> 00:00:52,260
And here just don't change anything and just click on OK.

14
00:00:52,300 --> 00:00:54,310
So we have this martial art class here.

15
00:00:54,550 --> 00:00:58,750
Let's double click on this marshal at the top of file in order to make this area right there.

16
00:00:59,200 --> 00:01:05,830
So now let's specify some instance variables for this martial arts class.

17
00:01:05,890 --> 00:01:10,060
The first one is going to be of type actually streambed.

18
00:01:10,090 --> 00:01:13,320
So I can't say private's strange.

19
00:01:13,780 --> 00:01:20,220
And the first instance variable is going to be martial arts any martial art any semicolon.

20
00:01:21,270 --> 00:01:21,780
Private.

21
00:01:21,800 --> 00:01:27,850
Let's create another thing since Friday he or and it is going to be that integer and the name of this

22
00:01:28,120 --> 00:01:31,000
instance variable is going to be martial art.

23
00:01:31,000 --> 00:01:36,250
Price martial arts price semi-colon.

24
00:01:37,820 --> 00:01:40,390
And the final instance.

25
00:01:40,400 --> 00:01:47,130
But it's going to be off against streambed and it is going to be the color so private's strange martial

26
00:01:47,130 --> 00:01:48,640
arts culture martial arts.

27
00:01:51,560 --> 00:01:53,030
Semi-colon.

28
00:01:53,030 --> 00:01:58,490
So now let's create a constructor for this martial art class.

29
00:01:59,250 --> 00:02:05,070
But before we actually create a constructor for this martial art class it's very important because we

30
00:02:05,070 --> 00:02:08,850
want to save our martial art objects to eschew light.

31
00:02:08,850 --> 00:02:13,620
It is very important that we specify an ID for each martial art.

32
00:02:13,830 --> 00:02:20,220
OK so let's create first let's create another instance variable for the ID.

33
00:02:20,220 --> 00:02:27,600
So in private and martial arts I-T martial arts ID semicolon.

34
00:02:28,070 --> 00:02:30,600
So let's create a constructed for this martial art class.

35
00:02:30,610 --> 00:02:36,830
Now so first we need to specify the access modifier of this constructor which is going to be public

36
00:02:37,720 --> 00:02:42,790
and the name of the constructor must be the same as the name of this class martial art.

37
00:02:43,360 --> 00:02:48,880
And just put a pair of practice year open and close this constructed by using these curly braces here.

38
00:02:49,000 --> 00:02:52,960
So let's specify some parameters for this martial art constructor.

39
00:02:53,230 --> 00:02:58,900
The first premise is going to be of type integer and the name is going to be the comma.

40
00:02:58,990 --> 00:03:05,390
The second parameter is going to be of types three and the name is going to be a martial arts name so

41
00:03:05,480 --> 00:03:10,900
let's name it actually as a name so that the name of these primates are isn't that good.

42
00:03:10,910 --> 00:03:14,030
It's not going to be the same as the name of this instance valuable.

43
00:03:14,450 --> 00:03:19,480
So the first argument or the first parameter actually is going to be that the price.

44
00:03:19,490 --> 00:03:28,080
So again it is going to be half that integer price come on and the final prime is of types 3 and then

45
00:03:28,080 --> 00:03:30,130
Aimee's color.

46
00:03:30,320 --> 00:03:30,730
Right.

47
00:03:30,900 --> 00:03:36,930
Let's go inside this constructor and let's initialize our instance valuables inside this constructor.

48
00:03:36,960 --> 00:03:43,830
So we have this marshal or Id like assignment operator ID semicolon So here I am assigning these ID

49
00:03:43,830 --> 00:03:45,880
to this motional ID here.

50
00:03:46,020 --> 00:03:53,340
And the second instance valuable is martial arts name assignment operator name semicon that I am referring

51
00:03:53,340 --> 00:04:00,870
to is name a parameter right this name argument actually and the first instance variable is going to

52
00:04:00,870 --> 00:04:07,890
be a martial art price assignment operator price semi-colon and the final instance variable is Marshal

53
00:04:07,890 --> 00:04:12,570
not color marshal or color assignment operator color semicolon.

54
00:04:12,900 --> 00:04:19,620
So now its time to create some actually setters and getters for our instance Spidy events.

55
00:04:19,650 --> 00:04:25,080
So after the ending curly brace of this constructor here inside this martial art class I'm going to

56
00:04:25,080 --> 00:04:31,170
write here inside this empty area and click on generate and here click on actually the first.

57
00:04:31,170 --> 00:04:32,480
Let's create some get here.

58
00:04:32,500 --> 00:04:33,810
So just click on get here.

59
00:04:34,020 --> 00:04:35,250
Select all these.

60
00:04:35,250 --> 00:04:36,990
Instance variables here.

61
00:04:37,340 --> 00:04:42,600
OK just hold down the shift key on your keyboard and then select all these instance variables and just

62
00:04:42,600 --> 00:04:43,740
click on OK.

63
00:04:43,800 --> 00:04:50,670
So now you can see that these guitars are created for us automatically by Android studio for instance

64
00:04:50,670 --> 00:04:51,420
variables.

65
00:04:51,420 --> 00:04:59,450
Right now let's create actually setters for instance variables after getting curly braces of the Smurfit

66
00:04:59,460 --> 00:05:04,350
get Marshall of color and before the eddying curly brace of this martial art class inside this empty

67
00:05:04,350 --> 00:05:11,670
area right click here just click on generate and click on setter select all this instance variables

68
00:05:12,360 --> 00:05:13,930
here and just click on OK.

69
00:05:13,950 --> 00:05:19,770
So now you can see that the setters for all are instance variables are actually created right here you

70
00:05:19,770 --> 00:05:25,710
can see it has set match that Id set modulars names that marginata price and set a lot of color.

71
00:05:25,770 --> 00:05:33,240
So now that we have this sitars we can use these setters in order to initialize our instance variables

72
00:05:33,510 --> 00:05:37,890
instead of directly referring to our instance variables here.

73
00:05:37,890 --> 00:05:40,770
I can use this settler's that I created here.

74
00:05:40,770 --> 00:05:46,650
Remember I told you in the Java section of the course that it's not recommended to directly access your

75
00:05:46,650 --> 00:05:49,370
instance variables even inside your class.

76
00:05:49,410 --> 00:05:51,310
Even inside this martial arts class.

77
00:05:51,360 --> 00:05:55,300
So let's delete these quotes here inside the constructor.

78
00:05:55,500 --> 00:05:58,550
And now I can't see cits martial art ID.

79
00:05:59,040 --> 00:06:06,450
And here I can pass ID here as an argument to dismiss it or I can say certain martial arts NE and here

80
00:06:06,480 --> 00:06:10,690
I can pass name here said Martial Arts.

81
00:06:10,800 --> 00:06:14,280
Actually price and I can't pass price here.

82
00:06:14,690 --> 00:06:19,980
And finally said Martial Art color and I can't pass the color here right.

83
00:06:20,060 --> 00:06:20,930
That's it.

84
00:06:21,320 --> 00:06:27,310
So this is our martial arts class in the next story and we're going to actually create a school like

85
00:06:27,350 --> 00:06:28,270
class.

86
00:06:28,280 --> 00:06:29,980
So thank you very much for watching.

87
00:06:29,990 --> 00:06:31,280
And I said and I said Tauriel.

