1
00:00:00,600 --> 00:00:06,310
OK everyone now inside this main activity class I want to actually create some objects.

2
00:00:06,330 --> 00:00:07,000
OK.

3
00:00:07,260 --> 00:00:14,820
So first of all let me actually specify the access modifier of my object to private and then I want

4
00:00:14,820 --> 00:00:17,550
these objects to be static.

5
00:00:17,820 --> 00:00:22,050
And this means that this object is actually a class object.

6
00:00:22,050 --> 00:00:22,510
OK.

7
00:00:22,650 --> 00:00:29,170
So we can actually do the first with the name of this object by using the class dot notation.

8
00:00:29,220 --> 00:00:32,670
OK the name of this class that the name of that object.

9
00:00:32,670 --> 00:00:33,330
OK.

10
00:00:33,750 --> 00:00:39,900
So you can actually delete this static keyboard here if you want to but are here I just wanted to show

11
00:00:39,900 --> 00:00:43,730
you that you can actually create static objects too.

12
00:00:43,860 --> 00:00:44,440
OK.

13
00:00:44,850 --> 00:00:45,880
So fine.

14
00:00:46,080 --> 00:00:49,340
And this finally means that this object is actually a constant.

15
00:00:49,650 --> 00:00:50,180
OK.

16
00:00:50,460 --> 00:00:53,390
And when we say that an object is actually a constant.

17
00:00:53,520 --> 00:01:01,920
This means that the reference that we have to that object is going to be a constant throughout the entire

18
00:01:01,920 --> 00:01:02,820
application.

19
00:01:02,850 --> 00:01:09,430
That reference is only referring to that object inside the memory and not any other objects.

20
00:01:09,460 --> 00:01:12,930
OK so fine on secure random.

21
00:01:13,270 --> 00:01:13,730
OK.

22
00:01:13,860 --> 00:01:15,310
Secure random.

23
00:01:15,510 --> 00:01:18,700
And the name of our object is secure.

24
00:01:19,050 --> 00:01:24,160
Random numbers.

25
00:01:24,300 --> 00:01:25,190
OK.

26
00:01:25,260 --> 00:01:29,780
Assignment operator new secure.

27
00:01:30,030 --> 00:01:30,790
Random.

28
00:01:31,110 --> 00:01:31,760
OK.

29
00:01:32,070 --> 00:01:39,360
So as you can see here I created an object from this secure random class and then I assigned this name

30
00:01:39,390 --> 00:01:45,570
to this object to secure random numbers and then I actually instantiated this object by using this new

31
00:01:45,590 --> 00:01:46,450
keyword here.

32
00:01:46,470 --> 00:01:47,060
OK.

33
00:01:47,430 --> 00:01:54,600
So when you instantiate an object this means that you're are actually creating a reference to that object

34
00:01:54,630 --> 00:01:55,590
inside the memory.

35
00:01:55,650 --> 00:02:03,090
OK so we have now our reference to the address of that object inside the memory.

36
00:02:03,090 --> 00:02:03,770
OK.

37
00:02:04,260 --> 00:02:08,030
So now I want to talk about a concept called in arms.

38
00:02:08,280 --> 00:02:13,890
OK so let's actually create on an income and then I actually are talking about in Java OK.

39
00:02:13,890 --> 00:02:21,910
So first let me specify the access modifier private's and income.

40
00:02:22,490 --> 00:02:22,820
OK.

41
00:02:22,830 --> 00:02:28,930
As you can see in some key vote we'll keep access modifier on keyboard.

42
00:02:29,100 --> 00:02:33,020
And then again I need to actually give a name to my name.

43
00:02:33,030 --> 00:02:42,740
So just type in hero status with the capital S status and then I need to actually open my by actually

44
00:02:42,750 --> 00:02:51,650
using an opening curly brace and then I need to close that in and by using our closing curly brace OK.

45
00:02:51,780 --> 00:02:58,290
So inside this you know I can actually put in some values so remember that you can in order to actually

46
00:02:58,290 --> 00:03:03,670
give values to an arm and the leaders of all of your values must be chapiter OK.

47
00:03:04,110 --> 00:03:06,400
This is actually a convention in Java.

48
00:03:06,750 --> 00:03:14,710
So for the first value just type in here not started yet.

49
00:03:15,230 --> 00:03:16,830
OK come on.

50
00:03:17,640 --> 00:03:19,710
And the second value is proceed

51
00:03:22,530 --> 00:03:23,050
OK.

52
00:03:23,140 --> 00:03:31,860
Comma on a first value is 1 and or fourth value is lost.

53
00:03:33,400 --> 00:03:37,600
OK so here as you can see we have an income.

54
00:03:37,780 --> 00:03:38,270
OK.

55
00:03:38,470 --> 00:03:41,820
And we gave a name to this in you know status.

56
00:03:41,940 --> 00:03:42,840
OK.

57
00:03:42,970 --> 00:03:45,220
The access modified of this is private.

58
00:03:45,250 --> 00:03:53,920
So it is of value is actually this is actually visible only to this class and no other classes can use

59
00:03:54,400 --> 00:03:55,110
this in.

60
00:03:55,210 --> 00:04:00,030
OK because we actually defined this as private.

61
00:04:00,340 --> 00:04:09,730
OK so in arms actually introduces a new type ok like in teacher for example when you create an integer

62
00:04:09,730 --> 00:04:15,850
variable like this the type of this variable is int integer.

63
00:04:15,920 --> 00:04:18,750
OK so it is just like this.

64
00:04:18,790 --> 00:04:19,310
OK.

65
00:04:19,540 --> 00:04:28,560
We have an income OK here aren't the type of our in is status OK it is just like your right here.

66
00:04:28,660 --> 00:04:29,240
OK.

67
00:04:29,320 --> 00:04:34,760
And the type of our variable is status defined or own type.

68
00:04:34,780 --> 00:04:41,800
Remember when you declare it when you declare an income you are actually defining your own type in that

69
00:04:42,010 --> 00:04:42,800
project.

70
00:04:43,000 --> 00:04:46,370
OK so this status is actually our own type.

71
00:04:46,510 --> 00:04:53,540
And these are the values actually the only values that we actually specified for this.

72
00:04:53,560 --> 00:04:58,020
You know OK this type can only accept these values.

73
00:04:58,060 --> 00:04:59,440
Not started yet.

74
00:04:59,650 --> 00:05:00,930
I made a mistake here.

75
00:05:01,030 --> 00:05:02,110
Not started yet.

76
00:05:02,140 --> 00:05:02,670
OK.

77
00:05:02,920 --> 00:05:09,730
So this arm this can only have this can only actually accept these values.

78
00:05:09,730 --> 00:05:11,120
Not started yet.

79
00:05:11,230 --> 00:05:13,750
Proceed one last.

80
00:05:13,960 --> 00:05:14,520
OK.

81
00:05:14,770 --> 00:05:19,150
And you may wonder what the type of these values.

82
00:05:19,170 --> 00:05:22,530
Ok the type of these values is actually integer.

83
00:05:22,810 --> 00:05:23,150
OK.

84
00:05:23,170 --> 00:05:28,940
Because assigning integer numbers to this type is a little confusing.

85
00:05:29,260 --> 00:05:38,010
I decided to actually assign some values that is human readable and a human can understand those values

86
00:05:38,340 --> 00:05:41,190
but actually those values are integer values.

87
00:05:41,190 --> 00:05:41,600
OK.

88
00:05:41,700 --> 00:05:46,010
So for example this in on here is actually 0.

89
00:05:46,120 --> 00:05:48,620
This value is actually 0.

90
00:05:48,630 --> 00:05:51,090
OK this value is 1.

91
00:05:51,090 --> 00:05:52,980
This value is 2.

92
00:05:53,190 --> 00:05:54,970
And this value is free.

93
00:05:55,220 --> 00:05:55,840
OK.

94
00:05:56,040 --> 00:06:02,220
So this in on here defines a set of named integer constants.

95
00:06:02,220 --> 00:06:04,400
So remember these are constants.

96
00:06:04,490 --> 00:06:09,170
OK we cannot change these values later in our code.

97
00:06:09,180 --> 00:06:14,100
These are constants and these are integer constants OK and start.

98
00:06:14,100 --> 00:06:18,660
And these are not actually starts with the value 0 by default.

99
00:06:18,660 --> 00:06:23,870
OK so this value is 0 1 2 3.

100
00:06:24,240 --> 00:06:25,620
OK.

101
00:06:25,710 --> 00:06:29,390
And these values are actually incremented by 1 automatically.

102
00:06:29,400 --> 00:06:32,900
If I actually put another value here for example something like this.

103
00:06:32,900 --> 00:06:36,920
This value is actually number fourth.

104
00:06:37,080 --> 00:06:37,980
OK.

105
00:06:38,400 --> 00:06:41,230
It is actually incremented by one automatically.

106
00:06:41,310 --> 00:06:45,010
So hopefully that makes sense and I'll talk more about it.

107
00:06:45,120 --> 00:06:51,620
So don't worry if there's if this doesn't make any sense to you let's actually go ahead and continue

108
00:06:51,650 --> 00:06:56,500
building our application and it will make sense to you at the end of this tutorial OK.

109
00:06:56,970 --> 00:07:03,440
So let's actually create some constants inside this class and remember we are actually creating this

110
00:07:04,170 --> 00:07:06,860
objects and this in an inside the class.

111
00:07:06,930 --> 00:07:07,370
OK.

112
00:07:07,410 --> 00:07:09,350
And not inside this creates method.

113
00:07:09,360 --> 00:07:15,780
So make sure that you actually create these values inside this class and here let's actually create

114
00:07:15,780 --> 00:07:17,290
some constants.

115
00:07:17,340 --> 00:07:24,080
So first of all I want to specify the access modifier of my constant so private.

116
00:07:24,970 --> 00:07:25,660
OK.

117
00:07:25,830 --> 00:07:27,280
Static.

118
00:07:28,100 --> 00:07:28,730
OK.

119
00:07:28,820 --> 00:07:32,380
Final int.

120
00:07:33,280 --> 00:07:33,900
OK.

121
00:07:34,200 --> 00:07:39,360
So as you can see here the access modifier of my constant is private.

122
00:07:39,410 --> 00:07:41,400
My constant is actually static.

123
00:07:41,570 --> 00:07:42,080
OK.

124
00:07:42,270 --> 00:07:47,490
You can actually delete this static key word here but I wanted to show you that you can actually create

125
00:07:47,490 --> 00:07:57,960
constants that are actually static and static means that we can refer to this actually valuable to this

126
00:07:57,960 --> 00:08:05,760
constant by actually referring to the name of this class without creating any objects from this class

127
00:08:05,850 --> 00:08:11,930
by referring to the name of this class that the name of this constant we can access the value of this

128
00:08:11,930 --> 00:08:12,450
constant.

129
00:08:12,450 --> 00:08:12,970
OK.

130
00:08:13,140 --> 00:08:15,230
So that's the rule for.

131
00:08:15,230 --> 00:08:18,350
Are you actually using a static variable or objects.

132
00:08:18,410 --> 00:08:19,130
OK.

133
00:08:19,440 --> 00:08:21,780
So hopefully that makes sense.

134
00:08:22,020 --> 00:08:28,350
And then now I want to actually give a name to my constant And remember when you create a constant the

135
00:08:28,350 --> 00:08:32,720
letters of the name of that constant should be capitalized.

136
00:08:32,760 --> 00:08:33,550
OK.

137
00:08:33,570 --> 00:08:37,120
The name of a constant is Tiger.

138
00:08:38,430 --> 00:08:41,080
Underline class.

139
00:08:42,180 --> 00:08:42,920
OK.

140
00:08:43,120 --> 00:08:47,310
And I want to assign a value to my variable for example number two.

141
00:08:47,960 --> 00:08:48,710
OK.

142
00:08:49,020 --> 00:08:55,250
So let's actually create another cons another constant private's static final.

143
00:08:56,000 --> 00:08:56,360
OK.

144
00:08:56,400 --> 00:09:01,810
Int the name of my variable this time is three.

145
00:09:02,730 --> 00:09:06,010
And then I assign the value free to my variable.

146
00:09:06,030 --> 00:09:09,670
Actually it is a constant OK a special type of variable.

147
00:09:09,690 --> 00:09:13,740
Ok constants are a special type of variable.

148
00:09:13,860 --> 00:09:18,410
Once we assign a value to those variables we cannot change that value.

149
00:09:18,510 --> 00:09:22,240
We cannot change that value of later in our code.

150
00:09:22,260 --> 00:09:35,670
Ok so private static final INT and this time the name of my variable is 7 with a capital.

151
00:09:35,670 --> 00:09:37,350
See here as you can see.

152
00:09:37,440 --> 00:09:50,310
And then I assign the value of 7 to my variable to my constant here private static final INT and at

153
00:09:50,340 --> 00:09:54,450
this time the name of my variable is the Levan.

154
00:09:55,070 --> 00:09:55,460
OK.

155
00:09:55,470 --> 00:09:59,600
And then I assigned a value 11 to this constant.

