1
00:00:00,540 --> 00:00:03,880
So does that name assignment operator name.

2
00:00:04,060 --> 00:00:11,510
OK the start screen assignment operator screen the start keyboard assignment operator keyboard.

3
00:00:11,550 --> 00:00:12,220
OK.

4
00:00:12,600 --> 00:00:15,710
So now it's actually adding some more lines of code here.

5
00:00:15,720 --> 00:00:20,850
So here I'm going to pasting some lines of code and then I'm going to explain to you what's going on

6
00:00:20,850 --> 00:00:21,120
here.

7
00:00:21,120 --> 00:00:21,880
OK.

8
00:00:22,170 --> 00:00:25,930
So here as you can see these are the lines of code that they actually pasted here.

9
00:00:25,950 --> 00:00:31,680
First of all I actually created a get here good name for this unnamed instance variable.

10
00:00:32,070 --> 00:00:36,180
And then I actually created a getter again for this screen instance variable.

11
00:00:36,180 --> 00:00:36,770
OK.

12
00:00:37,110 --> 00:00:43,440
And finally I created a get keyboard Moffit get here for these keyboard instance variable and notice

13
00:00:43,440 --> 00:00:50,250
that I didn't actually create setters for this instance variables because these instance variables are

14
00:00:50,250 --> 00:00:52,830
actually declared as actually final.

15
00:00:53,100 --> 00:00:54,700
And these are constants.

16
00:00:54,730 --> 00:01:01,130
OK so once we assign a value to these instance variables we cannot change that value later.

17
00:01:01,260 --> 00:01:07,950
OK so we don't need to actually create setters for these instance variables that are actually declared

18
00:01:07,980 --> 00:01:08,790
as final.

19
00:01:08,830 --> 00:01:16,070
OK so now let's actually override the two string Meffert that we actually inherit from the Object class.

20
00:01:16,080 --> 00:01:16,460
OK.

21
00:01:16,560 --> 00:01:23,520
So this computer class implicitly inherits all of the features and behaviors that are inside of the

22
00:01:23,610 --> 00:01:24,960
inside of the Object class.

23
00:01:25,050 --> 00:01:31,440
So if we can access the string method here two string and now as you can see we can overwrite these

24
00:01:31,440 --> 00:01:32,220
two string Meffert.

25
00:01:32,220 --> 00:01:32,700
OK.

26
00:01:32,760 --> 00:01:36,310
So let's actually delete this line of code here that says Return a super.

27
00:01:36,300 --> 00:01:37,250
That was strange.

28
00:01:37,470 --> 00:01:41,820
And now we can actually put in our own implementations inside of this method.

29
00:01:41,910 --> 00:01:46,710
So here I'm going to actually paste in a line of code here and then I'm going to explain to you what's

30
00:01:46,710 --> 00:01:47,960
going on here.

31
00:01:48,000 --> 00:01:53,250
So here I am saying that the return string data format and here in say that these double quotes I am

32
00:01:53,250 --> 00:01:58,090
actually specifying the format of my string value OK person s.

33
00:01:58,230 --> 00:02:01,680
So this person is talking is actually referring to this gets named argument.

34
00:02:01,710 --> 00:02:02,380
OK.

35
00:02:02,640 --> 00:02:08,070
And here I have a person and this is actually a newline character space per cent.

36
00:02:08,110 --> 00:02:15,850
It's again this token here dispersant S is actually for this screen Meffert OK and person.

37
00:02:15,840 --> 00:02:18,980
And this is actually a newline character space.

38
00:02:19,200 --> 00:02:24,730
And I have a person here that is actually referring to this keyboard Meffert here.

39
00:02:24,810 --> 00:02:25,550
OK.

40
00:02:26,040 --> 00:02:27,900
So hopefully that makes sense.

41
00:02:27,900 --> 00:02:30,920
And now let's actually create an abstract method.

42
00:02:30,960 --> 00:02:37,080
So as you can see here I actually created this abstract method here and I notice that I actually didn't

43
00:02:37,610 --> 00:02:44,970
are actually putting curly braces after this MF at name in order to put in our own implementations because

44
00:02:45,030 --> 00:02:49,520
abstract methods cannot be actually cannot have body.

45
00:02:49,670 --> 00:02:54,960
OK so if we're actually putting in curly braces here as you can see it's non-chain as an error and it

46
00:02:54,960 --> 00:02:58,340
says that abstract methods can not have a body.

47
00:02:58,430 --> 00:03:03,560
OK so we cannot actually create a body for this abstract Meffert.

48
00:03:03,780 --> 00:03:06,690
And the access modifier of this method is public.

49
00:03:06,900 --> 00:03:12,690
And as you can see it is if it is actually abstract the return type of this Meffert is double and the

50
00:03:12,690 --> 00:03:16,040
name of this method is evaluates per performance.

51
00:03:16,050 --> 00:03:16,750
OK.

52
00:03:17,130 --> 00:03:19,770
And this method actually is an abstract method.

53
00:03:19,950 --> 00:03:28,320
And the other classes that actually inherit from the computer class need to actually create a body for

54
00:03:28,320 --> 00:03:29,100
this method.

55
00:03:29,230 --> 00:03:29,920
OK.

56
00:03:30,160 --> 00:03:36,750
Otherwise with what those classes of would wind up with actually a compilation error and I'll show you

57
00:03:36,780 --> 00:03:40,020
in a second how you can actually use this method.

58
00:03:40,360 --> 00:03:46,250
But because I told you that a computer by itself is actually an abstract concept.

59
00:03:46,290 --> 00:03:47,430
OK.

60
00:03:47,760 --> 00:03:51,610
We declared this class as as an abstract class.

61
00:03:51,630 --> 00:03:52,190
OK.

62
00:03:52,410 --> 00:03:56,960
And this class has actually an abstract method evaluates performance.

63
00:03:57,090 --> 00:04:03,620
If I ask you to evaluate the performance of computer you may ask me that what kind of computer are this

64
00:04:03,870 --> 00:04:08,820
computer or laptop computer or a smart phone computer or a tablet computer.

65
00:04:08,940 --> 00:04:11,800
So this Meffert is actually an abstract benefit.

66
00:04:11,880 --> 00:04:12,420
OK.

67
00:04:12,630 --> 00:04:20,160
And the other classes that are actually called concrete classes such as this thub computer laptop laptop

68
00:04:20,160 --> 00:04:25,920
computer as you can see smartphone computer tablet computer These glasses are concretes glasses.

69
00:04:25,920 --> 00:04:26,430
OK.

70
00:04:26,700 --> 00:04:34,430
And if these glasses actually extend from this computer class as you can see they need to actually they

71
00:04:34,450 --> 00:04:40,530
need to actually create a body for the Smurfit they need to actually override this Meffert and create

72
00:04:40,620 --> 00:04:47,400
a body for this effect and specify what's the evaluate what's the actually performance or how how they

73
00:04:47,400 --> 00:04:51,900
can actually evaluate the performance of two of those specific computers.

74
00:04:51,900 --> 00:04:52,950
OK.

75
00:04:53,340 --> 00:04:55,240
So hopefully that makes sense.

76
00:04:55,260 --> 00:05:00,380
And remember that you cannot create an object from an abstract class OK.

77
00:05:00,440 --> 00:05:06,550
So let's actually go back go inside that inside of this top computer that have a fight here and now

78
00:05:06,800 --> 00:05:17,240
let's actually after the class name just typing here extends OK Computer and now it is now showing us

79
00:05:17,300 --> 00:05:17,960
an error.

80
00:05:18,020 --> 00:05:18,680
OK.

81
00:05:18,950 --> 00:05:23,690
And let's actually hover our mouse pointer over the whole area and see what happens.

82
00:05:23,690 --> 00:05:27,980
Class desktop computer must either be declared up.

83
00:05:28,010 --> 00:05:35,920
Abstract OK or implied or implement abstract method evaluates performance in computer.

84
00:05:36,020 --> 00:05:36,570
OK.

85
00:05:36,990 --> 00:05:46,160
So because you are actually saying that this computer extends computer we either need to actually declare

86
00:05:46,160 --> 00:05:54,430
this class as an abstract class or we must actually override the abstract Meffert that is actually inside

87
00:05:54,760 --> 00:05:57,310
of there are actually computer class.

88
00:05:57,320 --> 00:06:00,170
OK so that is actually putting some lines of code.

89
00:06:00,200 --> 00:06:03,410
And then I explain to you what's going on here.

90
00:06:03,470 --> 00:06:10,480
So first of all let's actually do declare some instance variables here inside of this stop computer.

91
00:06:10,820 --> 00:06:16,790
And as you can see here every desktop computer has a mouse every desktop computer has a super power

92
00:06:17,150 --> 00:06:20,220
and every desktop computer has a ram key.

93
00:06:20,420 --> 00:06:25,270
And as you can see here in my first instance variable is a private stream mouse.

94
00:06:25,490 --> 00:06:29,290
My second instance variable is private double Sibiu power.

95
00:06:29,480 --> 00:06:33,400
And my first instance variable is private double RAM.

96
00:06:33,520 --> 00:06:39,710
OK so now let's actually create a constructor for this desktop computer class.

97
00:06:39,710 --> 00:06:42,570
So here I'm going to actually pasting this constructor here.

98
00:06:42,710 --> 00:06:43,150
OK.

99
00:06:43,250 --> 00:06:49,670
And as you can see this is my constructor for this this computer class and the access modifier of this

100
00:06:49,670 --> 00:06:51,320
constructor is public.

101
00:06:51,440 --> 00:06:54,860
The name of this constructor is desktop computer.

102
00:06:54,860 --> 00:06:57,550
And this construct that actually accepts some arguments.

103
00:06:57,560 --> 00:06:58,070
OK.

104
00:06:58,310 --> 00:07:01,900
And the first argument as against is of type String name.

105
00:07:01,910 --> 00:07:07,910
The second argument against is of types 3 inch screen and the first argument as against C is again of

106
00:07:07,910 --> 00:07:09,630
type String keyboard.

107
00:07:09,710 --> 00:07:16,970
And here this fourth argument is of type String mouse here as you can see this fefe argument is actually

108
00:07:16,970 --> 00:07:19,920
of type double Sibiu CPO power.

109
00:07:20,210 --> 00:07:26,170
And here these six are argument as you can see is after double and the name of this argument is that

110
00:07:26,180 --> 00:07:31,820
I'm so here because we are actually inheriting all of the features and behaviors that are actually inside

111
00:07:31,820 --> 00:07:33,290
of this computer class.

112
00:07:33,290 --> 00:07:37,730
We need to initialize the constructor of the superclass.

113
00:07:37,730 --> 00:07:43,100
So as you can see inside of this computer class we have this constructor here and inside of this desktop

114
00:07:43,100 --> 00:07:50,950
computer I need to initialize the constructor of the superclass by just typing super name screen keyboard.

115
00:07:50,970 --> 00:07:56,270
OK as you can see this computer class as you can see this construct it actually accepts free arguments

116
00:07:56,600 --> 00:08:01,810
name screen keyboard and inside of this desktop computer.

117
00:08:02,510 --> 00:08:05,080
As you can see here these are super.

118
00:08:05,080 --> 00:08:09,400
He actually accepts free arguments name screen keyboard.

119
00:08:09,410 --> 00:08:10,150
OK.

120
00:08:10,530 --> 00:08:17,870
Now and here as you can see I am actually instantiating at my instance variables that I actually declared

121
00:08:17,930 --> 00:08:21,920
in this class the start mouse assignments operator mouse.

122
00:08:22,010 --> 00:08:27,320
Ok this that C-p a power assignment operator CPQ power.

123
00:08:27,430 --> 00:08:30,500
Does that RAM assignment operator.

124
00:08:30,650 --> 00:08:36,830
OK so now I'm going to actually pasting some lines of code here and then I'm going to actually explain

125
00:08:36,830 --> 00:08:38,420
to you what's going on here.

126
00:08:38,420 --> 00:08:39,100
OK.

127
00:08:39,740 --> 00:08:45,060
So as you can see here first of all I actually pasted this line of code here this method.

128
00:08:45,080 --> 00:08:45,660
OK.

129
00:08:46,040 --> 00:08:49,190
And the Axis modifier of this method is public.

130
00:08:49,190 --> 00:08:52,290
The return type of this method is three gets mouse.

131
00:08:52,310 --> 00:08:57,130
OK this is actually to get here for this mouse instance variable.

132
00:08:57,200 --> 00:08:58,170
OK.

133
00:08:58,340 --> 00:09:03,050
And here I actually created a set here for this mouse instance variable.

134
00:09:03,140 --> 00:09:04,800
Ok public it says mouse.

135
00:09:04,850 --> 00:09:05,500
OK.

136
00:09:05,930 --> 00:09:14,390
And then I actually created a getter for a super power instance variable gets you power.

137
00:09:14,660 --> 00:09:19,700
And then I created a setter for the spew power instance variable.

138
00:09:19,730 --> 00:09:26,450
And as you can see here inside of the Smurfette I actually created an if statement if the value of this

139
00:09:26,540 --> 00:09:27,040
argument.

140
00:09:27,050 --> 00:09:33,980
Ok so your power is less than or equal to number 0 then fro new legal argument exception.

141
00:09:34,080 --> 00:09:36,500
So if Sibiu power must be greater than zero.

142
00:09:36,500 --> 00:09:37,100
OK.

143
00:09:37,160 --> 00:09:43,980
And then here I am actually assigning the value of this argument to this spew power instance valuable

144
00:09:44,660 --> 00:09:52,370
and that I created a guitar for this Ahram instance variable and here I created a set here for this

145
00:09:52,590 --> 00:09:53,990
of an instance variable.

146
00:09:53,990 --> 00:10:01,420
And as you can see here inside of the setter I actually created an if statement if the value of this

147
00:10:01,680 --> 00:10:09,500
instance value bet is less than or equal to number zero then fro new illegal X argument exception RAM

148
00:10:09,680 --> 00:10:11,910
must be greater than number zero.

149
00:10:12,080 --> 00:10:18,790
And then here I am assigning the value of this argument to this instance variable does that from an

150
00:10:18,880 --> 00:10:20,430
assignment operator.

151
00:10:20,550 --> 00:10:20,890
OK.

