1
00:00:00,180 --> 00:00:05,620
Hire everyone in this theater you are really going to go ahead and create another Android application.

2
00:00:05,640 --> 00:00:09,520
So just click on this start in your Android studio project here.

3
00:00:09,660 --> 00:00:19,030
And for the application name just type in your app 29 and then click on Next choose API 16 Android 4.1

4
00:00:19,050 --> 00:00:22,020
jelly been for minimum STK click on next.

5
00:00:22,530 --> 00:00:27,280
And then choose Blanc's activity next and then click on finish.

6
00:00:27,300 --> 00:00:28,030
OK.

7
00:00:28,200 --> 00:00:34,350
Now let's actually select these hellova or text view here and then press on delete key on your keyboard

8
00:00:34,890 --> 00:00:38,010
and then double click on this LS folder here.

9
00:00:38,270 --> 00:00:40,380
Lay out activity on the line.

10
00:00:40,380 --> 00:00:41,570
Make that example.

11
00:00:42,030 --> 00:00:47,580
And then here selectees faluting action button here and then press on delete key on your keyboard.

12
00:00:47,580 --> 00:00:52,840
OK so now let's actually go back and say this content underly mean that exemption.

13
00:00:52,860 --> 00:00:57,630
And then here we can actually design the user interface of our application.

14
00:00:57,660 --> 00:00:58,190
OK.

15
00:00:58,260 --> 00:01:04,020
Now let's actually select this linearly elsewheres call here and put it at the center of this relatively

16
00:01:04,020 --> 00:01:04,610
out here.

17
00:01:04,620 --> 00:01:05,320
OK.

18
00:01:05,850 --> 00:01:13,230
And then let's actually select these are vertical scroll view here and put it at the center of this

19
00:01:13,470 --> 00:01:21,270
linearly vertical and then lets actually select is linearly onto a circle and put it inside this scroll

20
00:01:21,270 --> 00:01:21,970
view here.

21
00:01:22,050 --> 00:01:22,850
OK.

22
00:01:23,340 --> 00:01:28,740
And then now let's actually select this large text view and put it inside this linearly Ellsworth's

23
00:01:28,750 --> 00:01:31,840
the call that is inside of this scroll view here.

24
00:01:31,890 --> 00:01:32,730
OK.

25
00:01:33,150 --> 00:01:40,620
And double click on it deletes the text of the stakes and the ID just typing here takes the polymorphism.

26
00:01:40,800 --> 00:01:47,340
And now let's actually go back inside this main activity that are filed here and then let's actually

27
00:01:47,340 --> 00:01:51,830
select these lines of code that are actually related to the Options menu.

28
00:01:52,070 --> 00:01:52,710
OK.

29
00:01:53,130 --> 00:02:00,080
And then select these lines of code that are related to the floating action button and then delete them.

30
00:02:00,090 --> 00:02:03,240
So now we can actually put in our own code here.

31
00:02:03,240 --> 00:02:06,930
Now let's actually create some Java classes in our project.

32
00:02:06,930 --> 00:02:11,730
So just click on File New and then click on Java class.

33
00:02:12,030 --> 00:02:17,950
So for the first class just type in here sport OK and then click on OK.

34
00:02:18,480 --> 00:02:26,630
Let's actually create another class file new Java class and then the name of this class is boxing.

35
00:02:27,830 --> 00:02:29,120
OK.

36
00:02:29,960 --> 00:02:38,190
And let's actually create another class file new double class and the name of this class is kickboxing.

37
00:02:38,810 --> 00:02:41,520
Kick boxing.

38
00:02:42,200 --> 00:02:43,080
OK.

39
00:02:43,760 --> 00:02:51,510
Now let's actually create another job of classified new and Jobbik less.

40
00:02:51,680 --> 00:02:55,200
So for the name of this class is student.

41
00:02:56,200 --> 00:02:57,100
OK.

42
00:02:57,500 --> 00:03:08,900
Now let's actually create an interface new file new Ok Doba class and the name and here for the kind

43
00:03:08,900 --> 00:03:10,590
to choose interface.

44
00:03:10,920 --> 00:03:11,850
OK.

45
00:03:12,380 --> 00:03:16,750
And for the name of this interface just type in here life insurance

46
00:03:20,100 --> 00:03:22,590
OK and then click on OK.

47
00:03:23,300 --> 00:03:31,020
So now I want to talk about interface in Java so interface is actually like your class in Java and it

48
00:03:31,020 --> 00:03:36,170
is actually a reference type interface is actually a clip a collection of abstract methods.

49
00:03:36,180 --> 00:03:36,590
OK.

50
00:03:36,660 --> 00:03:40,200
So we can have a collection of abstract methods in interface.

51
00:03:40,260 --> 00:03:41,230
OK.

52
00:03:41,350 --> 00:03:48,950
And a class that implements an interface for example Maxime's when it wants to implement and in fact

53
00:03:49,050 --> 00:03:54,240
an interface to implements or life insurance as you can see life insurance is actually an interface.

54
00:03:54,240 --> 00:04:02,340
Ok so a class that implements an interface thereby inheriting the abstract methods that are actually

55
00:04:02,370 --> 00:04:04,050
inside of this life insurance.

56
00:04:04,050 --> 00:04:09,930
So as you can see here we don't have any abstract if it's inside of these life insurance interface but

57
00:04:09,930 --> 00:04:15,140
we can have abstract benefits inside of these life insurance interface.

58
00:04:15,150 --> 00:04:15,890
OK.

59
00:04:16,290 --> 00:04:23,760
And along with Misfit's along with abstract methods an interface may also contain constants default

60
00:04:23,790 --> 00:04:27,300
methods and static methods and or nested types.

61
00:04:27,340 --> 00:04:29,500
OK I'll talk more about them later.

62
00:04:29,650 --> 00:04:30,410
OK.

63
00:04:30,630 --> 00:04:37,000
But for now remember that in giove up you can only inherit from one class directly.

64
00:04:37,100 --> 00:04:42,840
OK so in Java we can only inherit all classes can only inherit from one class.

65
00:04:42,900 --> 00:04:43,370
OK.

66
00:04:43,560 --> 00:04:48,560
And they can implement our classes can implement as many interfaces as they want.

67
00:04:48,570 --> 00:04:48,950
OK.

68
00:04:48,990 --> 00:04:54,200
So let's actually create some abstract methods inside of these interface.

69
00:04:54,460 --> 00:04:54,900
OK.

70
00:04:54,960 --> 00:05:02,590
So by default of when we actually create an effect in this interface on if it's actually abstract.

71
00:05:02,750 --> 00:05:10,140
OK so now let's actually create an abstract method inside of these life insurance interface.

72
00:05:10,140 --> 00:05:11,050
So just open here.

73
00:05:11,070 --> 00:05:12,600
Double OK.

74
00:05:13,200 --> 00:05:16,730
And for the name of this abstract method just type in here.

75
00:05:16,900 --> 00:05:19,530
Evaluate OK.

76
00:05:19,600 --> 00:05:25,050
Cost of insurance okay.

77
00:05:25,200 --> 00:05:30,350
And then put a pair of Prentice's here and then put a semicolon at the end of your left.

78
00:05:30,390 --> 00:05:30,940
OK.

79
00:05:31,140 --> 00:05:38,430
So as you know methods in interface cannot have body OK a class that actually implements this interface

80
00:05:38,670 --> 00:05:44,550
must actually provide that body for this interface so as you can see here in say that this box in class

81
00:05:44,910 --> 00:05:48,360
as against this class actually implements this interface.

82
00:05:48,360 --> 00:05:54,630
So we need to actually provide a body to override that Meffert evaluate cost of insurance.

83
00:05:54,870 --> 00:05:59,310
That is actually declared it life insurance interface as you can see.

84
00:05:59,310 --> 00:06:04,050
We need to actually implement that method here inside of this box in class and then provide a body for

85
00:06:04,050 --> 00:06:04,440
that.

86
00:06:04,550 --> 00:06:05,320
OK.

87
00:06:05,910 --> 00:06:09,650
So now first of all let's actually go inside of these sports.

88
00:06:09,660 --> 00:06:15,570
The job of right here and inside of this class is actually putting that letter actually put in some

89
00:06:15,570 --> 00:06:16,850
more lines of code here.

90
00:06:16,980 --> 00:06:17,850
OK.

91
00:06:17,940 --> 00:06:23,240
And first of all let me tell you that this Porth class is actually an abstract class.

92
00:06:23,250 --> 00:06:23,670
OK.

93
00:06:23,760 --> 00:06:26,690
So if I ask you that please give me a sport.

94
00:06:26,830 --> 00:06:28,050
It doesn't make sense.

95
00:06:28,050 --> 00:06:30,670
You may ask what kind of sport do you want.

96
00:06:30,710 --> 00:06:39,780
OK so you mean I said you may want a boxing sport kickboxing sport or actually another kind of sport

97
00:06:39,900 --> 00:06:40,880
for example Judo.

98
00:06:40,990 --> 00:06:44,110
OK sport by itself is actually abstract.

99
00:06:44,160 --> 00:06:50,500
So we need to declare this concept really to actually declare this class as an abstract class.

100
00:06:50,820 --> 00:06:51,850
OK.

101
00:06:52,110 --> 00:06:53,710
So hopefully that makes sense.

102
00:06:53,760 --> 00:06:59,810
So first of all inside of this sport class this actually declared some instance variables here.

103
00:06:59,970 --> 00:07:00,590
OK.

104
00:07:00,900 --> 00:07:05,650
So as you can see here I have an instance variable private string name.

105
00:07:05,820 --> 00:07:06,630
OK.

106
00:07:07,110 --> 00:07:13,860
And I have another instance variable private and the type of this instance variable is strange and the

107
00:07:13,860 --> 00:07:15,980
name of this instance variable is OK.

108
00:07:16,050 --> 00:07:17,720
For example the rules of this sport.

109
00:07:17,730 --> 00:07:18,260
OK.

110
00:07:18,540 --> 00:07:20,430
Private string uniform.

111
00:07:20,910 --> 00:07:25,700
Int speed required ain't Pavarotti's quite yet.

112
00:07:25,720 --> 00:07:32,560
OK so we can actually declare this instance variables as private here.

113
00:07:32,590 --> 00:07:37,610
OK private and I can actually declare this instance variable as private too.

114
00:07:37,860 --> 00:07:43,790
OK so now let's actually create a constructor for this sports class.

115
00:07:43,800 --> 00:07:48,810
So now I'm gonna actually pasting this constructor here and then I'm going to actually explain to you

116
00:07:48,810 --> 00:07:50,190
what's going on here OK.

117
00:07:50,310 --> 00:07:54,320
So as you can see here this is my constructor for this sport class.

118
00:07:54,390 --> 00:07:54,800
OK.

119
00:07:54,900 --> 00:07:59,760
And as you can see public the name of the constructor must be the same as the name of the class.

120
00:07:59,760 --> 00:08:00,370
OK.

121
00:08:00,690 --> 00:08:03,750
And this constructor actually accepts some arguments.

122
00:08:03,750 --> 00:08:04,070
OK.

123
00:08:04,080 --> 00:08:11,200
String name string rules string uniform ain't required in power required.

124
00:08:11,220 --> 00:08:16,380
And as you can see here I am I try to instantiate in my instance variables that I actually declared

125
00:08:16,680 --> 00:08:18,190
inside of this sport class.

126
00:08:18,240 --> 00:08:22,090
So this does name actually refers to this name here.

127
00:08:22,110 --> 00:08:27,760
Assignment operator name the start rules assignments operator rules.

128
00:08:27,780 --> 00:08:32,010
OK so these rules actually refers to these local variable here.

129
00:08:32,070 --> 00:08:37,480
This argument rules the start unifor assignment operator unifor.

130
00:08:37,720 --> 00:08:46,080
OK the start speed required assignments operator speed required does that power required assignment

131
00:08:46,140 --> 00:08:48,110
operator power required.

132
00:08:48,170 --> 00:08:56,400
OK so here let me tell you that a support class this is class actually can implement implements this

133
00:08:56,400 --> 00:08:58,210
life insurance interface ok.

134
00:08:58,350 --> 00:08:59,880
Life insurance.

135
00:09:00,270 --> 00:09:00,870
OK.

136
00:09:01,050 --> 00:09:07,590
So now that we actually specify that this sport class actually implements this life insurance interface

137
00:09:07,920 --> 00:09:15,110
here now we can actually implement the method that is inside of these life insurance class here.

138
00:09:15,120 --> 00:09:15,600
OK.

139
00:09:15,620 --> 00:09:17,920
This evaluate cost of insurance.

140
00:09:17,970 --> 00:09:23,490
So let's let's actually go back and say the spikes in much of a fight here and then it's actually delete

141
00:09:23,550 --> 00:09:25,050
this piece of quote here.

142
00:09:25,140 --> 00:09:26,140
OK.

143
00:09:26,760 --> 00:09:34,260
And now let's actually go back inside this sports class as you can see here because our class is an

144
00:09:34,320 --> 00:09:35,490
abstract class.

145
00:09:35,550 --> 00:09:36,150
OK.

146
00:09:36,390 --> 00:09:41,820
And here we are actually implementing this life into a life insurance interface.

147
00:09:42,270 --> 00:09:45,420
We can actually or the compiler doesn't show us any error.

148
00:09:45,480 --> 00:09:51,540
Ok but if this class wasn't an abstract class let's actually delete this abstract keyword here.

149
00:09:51,570 --> 00:09:57,540
Now as you can see the compiler is actually showing us an error and it says class support must either

150
00:09:57,540 --> 00:10:03,710
be absolute must be either be declared abstract or implement abstract method.

151
00:10:03,750 --> 00:10:07,770
Evaluate cost of insurance in life insurance interface.

152
00:10:07,910 --> 00:10:08,170
Ok.

