1
00:00:00,390 --> 00:00:05,160
And let's actually create an object from disparate class inside this main activity that you will fight

2
00:00:05,160 --> 00:00:05,710
here.

3
00:00:05,920 --> 00:00:10,890
Well OK here let's actually create an object from this bird class.

4
00:00:10,890 --> 00:00:17,670
So first I need to refer to the name of this birth class my birth and I put an assignment operator here.

5
00:00:17,730 --> 00:00:26,830
Neil Baird and now I need to actually passing somebody else first I need to specify the name of my object.

6
00:00:26,940 --> 00:00:33,870
For example my birth and say Can I need to actually specify the color of my bird.

7
00:00:33,870 --> 00:00:42,930
For example white comma and now I need to actually specify the amount of speed of my bird for example

8
00:00:43,140 --> 00:00:49,280
600 Kamaal and now I need to actually specify the amount of power of my bed.

9
00:00:49,290 --> 00:00:51,880
For example 20 comma.

10
00:00:52,380 --> 00:00:56,530
And now I need to actually specify that whether my bird can fly or not.

11
00:00:56,580 --> 00:00:58,310
OK so true.

12
00:00:58,600 --> 00:00:59,350
Comma.

13
00:00:59,550 --> 00:01:04,460
And now I need to specify the number of blinks of my birth to.

14
00:01:04,830 --> 00:01:08,540
And I need to actually put in a semi-colon at the end of my statement.

15
00:01:08,580 --> 00:01:16,280
So now I can just type in here anti-X the beard that said text and in inside the prentices I can just

16
00:01:16,280 --> 00:01:20,590
refers to the name of this birth object my birth that's too strange.

17
00:01:21,080 --> 00:01:21,750
OK.

18
00:01:21,900 --> 00:01:23,650
So hopefully that makes sense.

19
00:01:23,730 --> 00:01:28,650
And let's actually run our project and see what happens because now I want to actually to show you another

20
00:01:28,650 --> 00:01:31,810
important point about our XML files.

21
00:01:31,830 --> 00:01:32,220
OK.

22
00:01:32,250 --> 00:01:32,800
OK.

23
00:01:32,850 --> 00:01:39,990
Now as you can see our plunged on this emulator here but we cannot see the values that are related to

24
00:01:39,990 --> 00:01:40,480
this.

25
00:01:40,500 --> 00:01:41,780
My first object here.

26
00:01:41,790 --> 00:01:42,390
OK.

27
00:01:42,660 --> 00:01:43,980
So what's going on here.

28
00:01:44,160 --> 00:01:51,190
Now we need to actually change some attributes that are related to the components of this screen here.

29
00:01:51,240 --> 00:01:52,000
OK.

30
00:01:52,440 --> 00:01:58,080
So let's actually go inside this content underline means that I mean here and now I want to actually

31
00:01:58,590 --> 00:02:04,810
talk about the weight attributes which is of very important attributes in exemplifies.

32
00:02:04,830 --> 00:02:05,500
OK.

33
00:02:05,820 --> 00:02:08,960
So let's actually select all of these components here.

34
00:02:09,000 --> 00:02:11,750
Other insight is exemplified here.

35
00:02:11,760 --> 00:02:17,510
All of these takes the view of components and let's actually find derivative weight attribute here.

36
00:02:17,540 --> 00:02:21,990
OK so now let's actually open the calculator.

37
00:02:21,990 --> 00:02:25,850
And now let's actually divide number one by five.

38
00:02:25,860 --> 00:02:26,450
OK.

39
00:02:26,520 --> 00:02:31,040
One divided by five zero point two.

40
00:02:31,050 --> 00:02:31,660
OK.

41
00:02:31,770 --> 00:02:34,050
So let's actually put this value here.

42
00:02:34,050 --> 00:02:37,720
Zero point two.

43
00:02:37,900 --> 00:02:43,140
OK so now let's actually reduce the margin of these components here.

44
00:02:43,170 --> 00:02:46,680
Inside the screen here for example 5.

45
00:02:46,920 --> 00:02:51,720
And let's actually reduce the padding of these takes three components here.

46
00:02:51,900 --> 00:02:54,450
And let's actually to change this value to 5.

47
00:02:54,740 --> 00:02:55,540
OK.

48
00:02:56,010 --> 00:02:59,730
And now let's actually go on our project and see what happens.

49
00:02:59,730 --> 00:03:05,060
So as you can see here now are these values are outputted to the screen here.

50
00:03:05,090 --> 00:03:09,870
OK the values that are related to the birth object is outputted here.

51
00:03:09,960 --> 00:03:17,800
A name might birth color white speed 600 power 20 fly true and number of beings.

52
00:03:17,930 --> 00:03:24,870
OK so you may wonder that what did you do here in this exemplified in order to show these actualities

53
00:03:24,930 --> 00:03:26,210
values to the screen.

54
00:03:26,350 --> 00:03:30,000
Let's actually talk a little bit about the vate attributes.

55
00:03:30,030 --> 00:03:33,420
That is a very important attribute in exemplifies.

56
00:03:33,440 --> 00:03:33,770
OK.

57
00:03:33,780 --> 00:03:37,930
And you need to actually use this attribute in all of your projects.

58
00:03:37,950 --> 00:03:38,440
OK.

59
00:03:38,610 --> 00:03:40,900
So let's actually doubleclick on this content.

60
00:03:40,920 --> 00:03:42,310
Underline that it's a man.

61
00:03:42,390 --> 00:03:45,500
So now as you can see we've got this vate attributes here.

62
00:03:45,660 --> 00:03:46,220
OK.

63
00:03:46,410 --> 00:03:47,050
I first.

64
00:03:47,060 --> 00:03:47,730
Divided.

65
00:03:47,730 --> 00:03:48,620
Number one.

66
00:03:48,750 --> 00:03:50,900
So here I actually divide it.

67
00:03:50,910 --> 00:03:53,620
Number one by number five.

68
00:03:53,760 --> 00:03:54,200
OK.

69
00:03:54,240 --> 00:03:55,770
So why did they do that.

70
00:03:55,770 --> 00:03:57,710
Because as you can see here.

71
00:03:57,960 --> 00:03:58,460
OK.

72
00:03:58,560 --> 00:04:02,640
So now as you can see here I assumed the height of the screen is 1.

73
00:04:02,670 --> 00:04:03,370
OK.

74
00:04:03,720 --> 00:04:08,960
And I wanted to actually put five components inside this screen here.

75
00:04:08,970 --> 00:04:09,560
OK.

76
00:04:09,630 --> 00:04:18,090
So I decided to actually divide number 1 which is the height of the screen by number 5 and the value

77
00:04:18,090 --> 00:04:19,120
is 0.2.

78
00:04:19,140 --> 00:04:19,650
OK.

79
00:04:19,830 --> 00:04:22,720
So as you can see here we've got five takes three balls here.

80
00:04:22,890 --> 00:04:23,380
OK.

81
00:04:23,430 --> 00:04:28,500
And I want to actually put these five takes to use here inside this screen here.

82
00:04:28,500 --> 00:04:33,000
And because we are actually using a linear layout there is vertical.

83
00:04:33,090 --> 00:04:37,790
It's going to actually put these of five components here vertically.

84
00:04:37,890 --> 00:04:42,610
And if you actually assume that the height of this screen is 100.

85
00:04:42,870 --> 00:04:44,740
And let's actually do that.

86
00:04:44,850 --> 00:04:49,710
For example we are now assuming that the height of this screen is 100.

87
00:04:49,710 --> 00:04:50,430
OK.

88
00:04:50,850 --> 00:04:57,810
And if you want to actually put five components inside the screen we need to actually divide this 100

89
00:04:57,810 --> 00:04:59,350
by number five.

90
00:04:59,430 --> 00:04:59,840
OK.

91
00:04:59,910 --> 00:05:01,850
Because we've got five components here.

92
00:05:01,860 --> 00:05:02,650
OK.

93
00:05:02,700 --> 00:05:04,680
And the value is number 20.

94
00:05:04,680 --> 00:05:09,170
So let's actually put the number twenty four The vate of these components here.

95
00:05:09,180 --> 00:05:09,960
OK.

96
00:05:10,080 --> 00:05:18,210
So as you can see here I put the number twenty for the vate attributes of these card takes three components

97
00:05:18,390 --> 00:05:20,330
as you can see here in this screen.

98
00:05:20,400 --> 00:05:21,070
OK.

99
00:05:21,390 --> 00:05:24,170
And let's actually go on our project and see what happens.

100
00:05:24,300 --> 00:05:27,450
So as you can see here now it's going to actually run our project.

101
00:05:27,490 --> 00:05:34,080
And now you will see that it doesn't make any difference now because as you can see here I assumed that

102
00:05:34,080 --> 00:05:37,000
the height of our screen is is 100.

103
00:05:37,080 --> 00:05:37,770
OK.

104
00:05:38,010 --> 00:05:41,520
And I actually divided that 100 by number five.

105
00:05:41,700 --> 00:05:44,520
And the result was 20 and I actually put.

106
00:05:44,580 --> 00:05:50,910
And I actually assigned number 20 to the lay out rate of these takes the objects here of these takes

107
00:05:50,960 --> 00:05:51,780
you.

108
00:05:51,810 --> 00:05:52,580
OK.

109
00:05:52,920 --> 00:05:57,960
And now as you can see it doesn't make any difference if you assume the height of the screen actually

110
00:05:57,960 --> 00:06:00,840
assume the value of the height of the screen number one.

111
00:06:00,840 --> 00:06:04,400
Or if you assume the value of the height of the screen is 100.

112
00:06:04,410 --> 00:06:04,920
OK.

113
00:06:05,010 --> 00:06:06,890
It doesn't make any difference.

114
00:06:06,990 --> 00:06:07,960
OK.

115
00:06:08,520 --> 00:06:12,840
And as you can see it pood These are five components here.

116
00:06:13,060 --> 00:06:14,460
Inside this screen here.

117
00:06:14,460 --> 00:06:14,970
OK.

118
00:06:15,150 --> 00:06:20,790
And I actually reduced the number of markings and the number of padding of these components a little

119
00:06:20,790 --> 00:06:21,410
bit.

120
00:06:21,420 --> 00:06:22,000
OK.

121
00:06:22,050 --> 00:06:26,880
So as you can see here now all of these attributes are inside the screen here.

122
00:06:27,120 --> 00:06:27,650
OK.

123
00:06:27,660 --> 00:06:29,380
So hopefully that makes sense.

124
00:06:29,400 --> 00:06:30,750
So it lay out.

125
00:06:30,760 --> 00:06:36,030
Wait we can actually specify a size ratio between multiple views.

126
00:06:36,030 --> 00:06:36,600
OK.

127
00:06:36,720 --> 00:06:39,900
So as you can see here we've got multiple takes to use here.

128
00:06:39,930 --> 00:06:40,460
OK.

129
00:06:40,560 --> 00:06:47,960
And I want Actually every each of these takes two views to actually take one fifth of the layout height.

130
00:06:48,080 --> 00:06:48,570
OK.

131
00:06:48,660 --> 00:06:53,720
So first I actually assumed that the layout height of this screen is one hundred.

132
00:06:53,910 --> 00:06:58,310
And then I divided that 100 by number five.

133
00:06:58,420 --> 00:07:00,220
OK OK because I have five.

134
00:07:00,340 --> 00:07:01,620
I'll text you here.

135
00:07:01,620 --> 00:07:02,410
OK.

136
00:07:02,430 --> 00:07:08,200
And the result was number 20 and then I assigned numbers 20 to this lay out eight.

137
00:07:08,220 --> 00:07:08,710
OK.

138
00:07:08,880 --> 00:07:13,690
So I gave a lay out weight of 20 to each of these picks to use here.

139
00:07:13,740 --> 00:07:14,460
OK.

140
00:07:14,460 --> 00:07:19,760
Each of these takes here actually to take von fefe of the layout height.

141
00:07:19,830 --> 00:07:20,560
OK.

142
00:07:20,880 --> 00:07:25,670
So that's why we can't actually see all of these values here.

143
00:07:25,710 --> 00:07:30,710
OK because each of these takes views actually take one fifth of the screen.

144
00:07:30,840 --> 00:07:31,690
OK.

145
00:07:32,130 --> 00:07:34,170
So hopefully that makes sense.

146
00:07:34,260 --> 00:07:39,370
And now I want to actually talk about casting objects in Java.

147
00:07:39,420 --> 00:07:44,580
OK so now that you actually know all about inheritance in Java are you going to actually talk about

148
00:07:44,700 --> 00:07:46,620
caste themed objects.

149
00:07:46,620 --> 00:07:47,040
OK.

150
00:07:47,070 --> 00:07:52,540
So as you can see here we've got these five text view objects here.

151
00:07:52,560 --> 00:07:53,340
OK.

152
00:07:53,730 --> 00:08:00,930
And let's actually hold the comment key and then click on the text you hear if you are using a Windows

153
00:08:00,930 --> 00:08:06,380
machine you need to actually hold the control key on your keyboard and then click on takes to you.

154
00:08:06,390 --> 00:08:06,920
OK.

155
00:08:07,110 --> 00:08:10,000
So as you can see here this is our text view class here.

156
00:08:10,050 --> 00:08:10,530
OK.

157
00:08:10,590 --> 00:08:17,530
And this text your class is actually inheriting all of the features and behaviors that are inside this

158
00:08:17,780 --> 00:08:18,350
view class.

159
00:08:18,360 --> 00:08:19,020
OK.

160
00:08:19,020 --> 00:08:23,250
So we can actually say that this takes the class ease of view.

161
00:08:23,550 --> 00:08:24,370
OK.

162
00:08:24,780 --> 00:08:31,170
And here inside is main activity that Java right here as you can see because you are actually referring

163
00:08:31,440 --> 00:08:35,010
to a component inside the screen as you can see.

164
00:08:35,310 --> 00:08:36,830
We've got these components here.

165
00:08:36,840 --> 00:08:37,500
OK.

166
00:08:37,830 --> 00:08:44,010
Because we are actually referring to those components we need to specify that we are actually referring

167
00:08:44,340 --> 00:08:46,600
to our text view component.

168
00:08:46,620 --> 00:08:47,440
OK.

169
00:08:47,670 --> 00:08:52,750
So here we are truly casting that object to a text art object.

170
00:08:52,770 --> 00:08:58,820
Otherwise the compiler may finish that we are actually referring to our view object.

171
00:08:58,970 --> 00:08:59,490
OK.

172
00:08:59,580 --> 00:09:01,720
But this is our text view.

173
00:09:01,830 --> 00:09:02,470
OK.

174
00:09:02,790 --> 00:09:07,980
So that's why if you actually cast at this object to our text you object.

175
00:09:07,980 --> 00:09:08,440
OK.

176
00:09:08,520 --> 00:09:09,780
So this is very important.

177
00:09:09,840 --> 00:09:15,780
As you can see here inside this text your class this text is inheriting all of the features and behaviors

178
00:09:16,110 --> 00:09:17,520
of this class.

179
00:09:17,840 --> 00:09:22,150
And this means that this takes through ease of view.

180
00:09:22,430 --> 00:09:23,010
OK.

181
00:09:23,130 --> 00:09:30,240
So Vieni to actually cast this object to a text view in order to let the compiler know that we are actually

182
00:09:30,240 --> 00:09:32,390
referring to our text view object.

183
00:09:32,400 --> 00:09:32,840
OK.

184
00:09:32,940 --> 00:09:37,500
But I think that's enough for now about our casting objects.

185
00:09:37,500 --> 00:09:37,990
OK.

186
00:09:38,070 --> 00:09:42,630
Later in this course more familiar with casting objects in Java.

187
00:09:42,810 --> 00:09:44,400
But for now it's enough.

188
00:09:44,920 --> 00:09:47,890
And our Forth Android application is finished.

189
00:09:48,060 --> 00:09:48,800
OK.

190
00:09:49,200 --> 00:09:53,370
And we have successfully built our Forth Android application.

191
00:09:53,490 --> 00:09:59,370
And if you have any questions about inheritance in Java please post the discussion in the course and

192
00:09:59,370 --> 00:10:02,290
then I'll do my best to answer your questions.

193
00:10:02,730 --> 00:10:07,990
And thank you very much for watching and I'll see you in the next tutorial.

