1
00:00:00,370 --> 00:00:07,140
This that operating system assignments operator operating system does start a Super Power assignment

2
00:00:07,170 --> 00:00:09,830
operator Sibiu power and does that RAM.

3
00:00:09,900 --> 00:00:10,440
OK.

4
00:00:10,580 --> 00:00:13,240
Assignment operator ram OK.

5
00:00:13,680 --> 00:00:15,420
So hopefully that makes sense.

6
00:00:15,570 --> 00:00:18,270
And now is actually putting some more lines of code here.

7
00:00:18,300 --> 00:00:24,670
So as you can see here I have a get her get her for this operating system instance variable.

8
00:00:24,720 --> 00:00:25,260
OK.

9
00:00:25,350 --> 00:00:28,930
And then I have a here for this operating system instance variable.

10
00:00:29,010 --> 00:00:29,680
OK.

11
00:00:30,000 --> 00:00:32,670
And then I have another get here for this.

12
00:00:32,680 --> 00:00:39,150
So if you power instance malleable and I have a set here for this Sibiu power an instance variable and

13
00:00:39,150 --> 00:00:43,650
inside of set for a first about I actually created an if statement.

14
00:00:43,650 --> 00:00:50,490
If the value of these CPO power is less than or equal to number 0 or if the value of this argument is

15
00:00:50,490 --> 00:00:57,450
less than or equal to number 0 then throw a new illegal argument exception the value of this Depue power

16
00:00:57,630 --> 00:00:59,470
must be greater than zero.

17
00:00:59,460 --> 00:00:59,900
OK.

18
00:00:59,970 --> 00:01:03,900
And then here I am actually instantiating this instance variable.

19
00:01:03,960 --> 00:01:06,760
Does that power power Sibiu power.

20
00:01:06,930 --> 00:01:07,480
OK.

21
00:01:07,860 --> 00:01:16,650
And here I actually created a getter for this instance variable and here I actually created a set for

22
00:01:16,650 --> 00:01:17,970
this instance variable.

23
00:01:18,000 --> 00:01:24,840
And again I created another if statement if the value of this ram argument as you can see here is less

24
00:01:24,840 --> 00:01:31,330
than or equal to number 0 then Frode new illegal argument exception then the value of the must be greater

25
00:01:31,350 --> 00:01:32,350
than zero.

26
00:01:32,580 --> 00:01:38,710
And here I actually initialized this instance variable at the start of the assignment operator.

27
00:01:38,790 --> 00:01:45,690
So here if the user of this settlement actually are assigned an invalid number.

28
00:01:45,800 --> 00:01:47,200
OK that is one example.

29
00:01:47,340 --> 00:01:49,650
Equal or less than number.

30
00:01:49,710 --> 00:01:51,710
Then that application is going to crash.

31
00:01:51,770 --> 00:02:00,520
OK so now let's actually implement the inherited method that we actually have that actually that is

32
00:02:00,520 --> 00:02:02,240
inside of this computer class.

33
00:02:02,280 --> 00:02:02,570
OK.

34
00:02:02,600 --> 00:02:04,210
Evaluate performance.

35
00:02:04,230 --> 00:02:08,450
So here I just need to type in evaluate a performance.

36
00:02:08,450 --> 00:02:14,180
Now as you can see if you are writing this Moffats or just delete this line of code here and inside

37
00:02:14,180 --> 00:02:17,000
of this method and actually putting our own code here.

38
00:02:17,040 --> 00:02:17,440
OK.

39
00:02:17,490 --> 00:02:23,790
So here inside of this method as you can see I am returning the result of multiplication of these two

40
00:02:23,790 --> 00:02:27,200
instance variables so power multiplied by Ram.

41
00:02:27,360 --> 00:02:33,390
OK so another important point about is these exceptions that are remember that these are.

42
00:02:33,480 --> 00:02:35,480
This is not the right way to write your code.

43
00:02:35,520 --> 00:02:35,980
OK.

44
00:02:36,210 --> 00:02:40,790
But here I just wanted to show you how you can actually use exceptions in your projects.

45
00:02:40,800 --> 00:02:46,710
Ok so now let's actually overwrite the two string method that you actually inherit from the computer

46
00:02:46,710 --> 00:02:47,240
class.

47
00:02:47,310 --> 00:02:53,270
So now let's actually delete this line of code here and now we can actually put in our own implementations

48
00:02:53,310 --> 00:02:53,780
here.

49
00:02:53,970 --> 00:02:58,770
So now I'm going to actually putting a piece of code here and then I'm going to explain to you what's

50
00:02:58,770 --> 00:02:59,600
going on here.

51
00:02:59,640 --> 00:03:00,100
OK.

52
00:03:00,150 --> 00:03:05,700
So as you can see here I am saying that the return string data formats and inside of these double quotes

53
00:03:05,790 --> 00:03:08,570
I am specifying the format of my string value.

54
00:03:08,640 --> 00:03:15,390
So here as you can see this percent as here is actually referring to this super that string here.

55
00:03:15,780 --> 00:03:24,520
And this person here person S is for this spew power here and here is a person f is actually for the

56
00:03:24,570 --> 00:03:25,620
small numbers.

57
00:03:25,650 --> 00:03:27,640
So this is for get Sibiu power.

58
00:03:27,720 --> 00:03:28,320
OK.

59
00:03:28,470 --> 00:03:31,990
Sibiu power instance Raddy but actually is of type double.

60
00:03:32,010 --> 00:03:32,720
OK.

61
00:03:33,000 --> 00:03:35,630
And we have another percent end here.

62
00:03:35,850 --> 00:03:39,710
This is a new line character person as this is for RAM.

63
00:03:39,700 --> 00:03:41,840
Here it is for lab here.

64
00:03:42,000 --> 00:03:44,570
This string by the string value.

65
00:03:44,580 --> 00:03:45,290
OK.

66
00:03:45,540 --> 00:03:48,670
And we have another percent here.

67
00:03:48,720 --> 00:03:50,400
This is for kids right here.

68
00:03:50,430 --> 00:03:51,120
OK.

69
00:03:51,600 --> 00:03:53,290
So hopefully that makes sense.

70
00:03:53,310 --> 00:03:58,410
And now let's actually go inside this tablet computer here tablet computer that of a fine.

71
00:03:58,560 --> 00:04:04,490
And now after the class named after this tablet tablet our computer class name he has just stepped in

72
00:04:04,510 --> 00:04:07,440
he had extents smartphone computer.

73
00:04:07,620 --> 00:04:08,050
OK.

74
00:04:08,130 --> 00:04:14,880
So that is actually and is our relationship between these two classes a tablet computer is our smart

75
00:04:15,060 --> 00:04:16,200
phone computer.

76
00:04:16,290 --> 00:04:17,070
OK.

77
00:04:17,400 --> 00:04:18,980
So hopefully that makes sense.

78
00:04:18,990 --> 00:04:22,340
And he and as you can see this is actually showing us an error.

79
00:04:22,470 --> 00:04:30,090
And if I hover my mouse pointer over the area it says there is not a default constructor available in

80
00:04:30,180 --> 00:04:32,640
actually smart one computer class.

81
00:04:32,850 --> 00:04:37,710
Ok so here I need to actually put in some instance variables.

82
00:04:37,710 --> 00:04:38,120
OK.

83
00:04:38,160 --> 00:04:44,610
So as you can see here this is my instance variable that is specific only to this tablet computer class

84
00:04:44,880 --> 00:04:47,260
private int screen size.

85
00:04:47,340 --> 00:04:51,600
And as you can see here I didn't instantiate this instance variable here.

86
00:04:51,630 --> 00:04:57,740
OK so here let's actually create a constructor for this tablet computer class OK.

87
00:04:58,050 --> 00:05:03,440
And as you can see here this is my constructor for this tablet computer class.

88
00:05:03,520 --> 00:05:04,030
OK.

89
00:05:04,240 --> 00:05:09,380
And this constructed actually accepts some arguments name screen keyboard.

90
00:05:09,490 --> 00:05:10,070
OK.

91
00:05:10,300 --> 00:05:17,600
And here you have this argument operating system Sibiu power RAM and screen size.

92
00:05:17,620 --> 00:05:18,160
OK.

93
00:05:18,310 --> 00:05:23,800
And here because we are actually inheriting all of the features and behaviors that are actually inside

94
00:05:23,800 --> 00:05:30,100
of these smart phone computer class we need to actually initialize the constructor of the superclass.

95
00:05:30,100 --> 00:05:35,840
So super name screen keyboard operating system Sibiu power Lamhe.

96
00:05:36,190 --> 00:05:36,840
OK.

97
00:05:37,090 --> 00:05:41,410
And these are the arguments that this smartphone computer constructive needs.

98
00:05:41,410 --> 00:05:41,910
OK.

99
00:05:42,040 --> 00:05:43,030
As you can see here.

100
00:05:43,270 --> 00:05:43,880
OK.

101
00:05:44,170 --> 00:05:50,160
And now we have actually an instance variable screen size.

102
00:05:50,410 --> 00:05:54,180
And here as you can see this is our argument screen size here.

103
00:05:54,370 --> 00:06:01,240
And here I actually created an if statement if the value of this screen size argument is less than or

104
00:06:01,270 --> 00:06:02,810
equal to number 0.

105
00:06:02,890 --> 00:06:04,480
Then a new legal argument.

106
00:06:04,480 --> 00:06:08,970
Exception the screen size must be greater than number 0.

107
00:06:08,980 --> 00:06:09,470
OK.

108
00:06:09,700 --> 00:06:11,780
So here I just need to type in greater.

109
00:06:12,130 --> 00:06:20,170
And as you can see here and I actually instantiated this instance valuable destock screen size assignment

110
00:06:20,200 --> 00:06:21,790
operator screen size.

111
00:06:22,180 --> 00:06:28,720
And now this actually creates our getter and asserter for this screen size instance variable.

112
00:06:28,720 --> 00:06:34,890
So just right click here and say that this class generates getter and setter screen size.

113
00:06:34,960 --> 00:06:35,780
OK.

114
00:06:36,100 --> 00:06:42,040
So this is the so these are actually that are getter and the Center for our own instance variable.

115
00:06:42,340 --> 00:06:45,260
And as you can see here it doesn't show us any error.

116
00:06:45,310 --> 00:06:46,130
OK.

117
00:06:46,210 --> 00:06:52,870
Because this smartphone or computer class as you can see here is inheriting all of the features and

118
00:06:52,870 --> 00:06:56,290
behaviors that are inside of these abstract computer class.

119
00:06:56,350 --> 00:06:56,760
OK.

120
00:06:56,830 --> 00:07:04,460
And inside of these are smartphone or computer class I actually implemented this evaluate performance

121
00:07:04,470 --> 00:07:04,880
Smiffy.

122
00:07:04,900 --> 00:07:09,470
This is actually an abstract method OK inside of a tablet computer class.

123
00:07:09,510 --> 00:07:13,320
We actually don't need to again implement that method.

124
00:07:13,530 --> 00:07:13,850
OK.

125
00:07:13,870 --> 00:07:20,030
Inside of these tablets computer class I don't need to actually implement that method again.

126
00:07:20,280 --> 00:07:20,720
OK.

127
00:07:20,770 --> 00:07:27,190
If you don't want to actually change the implementation of this method OK because I actually inherit

128
00:07:27,280 --> 00:07:32,970
all of the features and behaviors that are actually inside of this smart phone computer class or case

129
00:07:33,280 --> 00:07:35,400
I actually inherit this method here.

130
00:07:35,470 --> 00:07:35,700
OK.

131
00:07:35,710 --> 00:07:37,280
And this implementation.

132
00:07:37,450 --> 00:07:43,690
And if I don't want to actually change this implementation inside of this tablet computer class I don't

133
00:07:43,690 --> 00:07:46,840
need to actually overwrite that method here again.

134
00:07:46,930 --> 00:07:54,070
And if I actually call this method this evaluate performance Smurfit on an object of this tablet computer

135
00:07:54,070 --> 00:08:00,040
class is going to actually return the result of my multiplication of the value of the C-u power and

136
00:08:00,040 --> 00:08:01,550
the value of the land to me.

137
00:08:01,630 --> 00:08:08,810
OK so now let's actually overwrite the two string method here inside of this tablet computer class.

138
00:08:09,250 --> 00:08:09,780
OK.

139
00:08:09,940 --> 00:08:12,650
And delete this implementation inside of this method.

140
00:08:12,790 --> 00:08:17,580
And now we can actually put in our own implementations inside of these two string Meffert.

141
00:08:17,590 --> 00:08:22,750
So as you can see here I'm going to actually pasting a piece of code here and then I'm going to explain

142
00:08:22,750 --> 00:08:24,150
to you what's going on here.

143
00:08:24,430 --> 00:08:27,530
So as you can see here it says Return string format.

144
00:08:27,670 --> 00:08:28,190
OK.

145
00:08:28,310 --> 00:08:32,860
And say that the double quotes I am specifying the format of my string value.

146
00:08:32,920 --> 00:08:33,420
Percent.

147
00:08:33,430 --> 00:08:34,720
S is for super.

148
00:08:34,720 --> 00:08:35,560
That was 3M.

149
00:08:35,680 --> 00:08:38,480
So remember super is referring to the superclass.

150
00:08:38,490 --> 00:08:42,360
So in this case the superclass is smartphone computer OK.

151
00:08:42,430 --> 00:08:45,980
And inside of this smart phone computer we have these two three method.

152
00:08:46,000 --> 00:08:47,120
As you can see here.

153
00:08:47,170 --> 00:08:49,780
So it's going to actually return this string value to me.

154
00:08:49,780 --> 00:08:50,340
OK.

155
00:08:50,440 --> 00:08:56,770
So you support that with strong super strength Sibiu power gets you power as you can see here and ram

156
00:08:56,930 --> 00:08:58,110
Guthrum OK.

157
00:08:58,480 --> 00:09:04,330
And here as you can see inside of these two string Meffert we are referring to the Super Tuesday.

158
00:09:04,330 --> 00:09:08,050
So it's connected to return that string value to us percent.

159
00:09:08,060 --> 00:09:14,860
And this is actually a new line character and we have another person as he he here screen size colon

160
00:09:15,910 --> 00:09:17,550
and we have person here.

161
00:09:17,550 --> 00:09:22,690
So this gets screen size here as you can see returns a value of type integer.

162
00:09:22,690 --> 00:09:25,540
OK so personally is for arguments of type integer.

163
00:09:25,540 --> 00:09:26,180
OK.

164
00:09:26,740 --> 00:09:32,210
And now let's actually go back inside the main activity that job fine here and now we've been actually

165
00:09:32,230 --> 00:09:33,800
putting some lines of code here.

166
00:09:33,820 --> 00:09:40,640
So here inside of this uncreate method let's actually create some objects from the text class.

167
00:09:40,900 --> 00:09:41,400
OK.

168
00:09:41,620 --> 00:09:46,230
As you can see here I created some objects from these are text for your class.

169
00:09:46,240 --> 00:09:52,110
So as you can CTX the desktop computer and here I referred to the name of this idea or that identity.

170
00:09:52,210 --> 00:09:56,590
The desktop computer SD takes the laptop computer.

171
00:09:56,590 --> 00:10:05,350
And here I refer to this ID are that ID the laptop computer geeks the smart one computer or the smartphone

172
00:10:05,370 --> 00:10:10,380
computer takes the tablet computer art that's 86 that tablet computer.

173
00:10:10,470 --> 00:10:17,910
And here as you can see the desktop computer performance takes the desktop computer performance takes

174
00:10:17,940 --> 00:10:24,290
the laptop computer performance and as you can see are that I.D. takes the laptop computer performance.

175
00:10:24,330 --> 00:10:28,670
And here we have this theory the smart phone computer performance.

176
00:10:28,800 --> 00:10:33,810
And here I have art that Id thought TXI the smartphone computer performance.

177
00:10:33,810 --> 00:10:40,600
And here I have the XTi tablet computer performance and here as you can see the tablet computer performance

178
00:10:40,600 --> 00:10:41,100
is OK.

