1
00:00:01,020 --> 00:00:13,130
Private static final INT and this time the name of my constant is Panter and then I assigned the value

2
00:00:13,140 --> 00:00:16,120
12 to my constant here.

3
00:00:16,200 --> 00:00:17,200
OK.

4
00:00:17,700 --> 00:00:22,430
So hopefully that makes sense and then it's actually OK.

5
00:00:22,540 --> 00:00:27,680
Now let's actually declare some objects here inside of this main activity class here.

6
00:00:27,720 --> 00:00:28,490
OK.

7
00:00:28,770 --> 00:00:33,110
So first of all I want to declare an object of type text.

8
00:00:33,250 --> 00:00:34,030
View.

9
00:00:34,230 --> 00:00:39,540
Takes view he makes the calculations and I put a semi-colon here.

10
00:00:39,630 --> 00:00:44,010
And remember we are here actually declaring an object of type text.

11
00:00:44,020 --> 00:00:50,930
View we do not instantiate this object yet let's actually declare another object image view.

12
00:00:51,710 --> 00:00:52,500
OK.

13
00:00:52,770 --> 00:00:58,490
I m g dice semicolon button.

14
00:00:59,290 --> 00:00:59,980
OK.

15
00:01:00,470 --> 00:01:04,280
And between restart game let me actually explain again.

16
00:01:04,290 --> 00:01:14,190
We are here only declaring these objects and these are objects actually do not refer to any valid object

17
00:01:14,190 --> 00:01:18,990
yet these objects just referred to a null object inside the memory.

18
00:01:19,020 --> 00:01:20,820
These activities are only references.

19
00:01:20,830 --> 00:01:27,210
OK these are only different references and these are only actually referring to another object inside

20
00:01:27,230 --> 00:01:30,850
the memory because we do not actually instantiate these objects yet.

21
00:01:30,900 --> 00:01:35,340
And if you want to use these objects inside this and create Meffert or any other methods you're going

22
00:01:35,330 --> 00:01:40,860
to actually get some errors and you end up with with an exception.

23
00:01:40,860 --> 00:01:42,980
And your application may crash.

24
00:01:43,040 --> 00:01:48,740
OK so you need to actually always make sure that you are instance creating your objects.

25
00:01:48,800 --> 00:01:52,960
OK so but here I just want to declare these objects.

26
00:01:53,190 --> 00:01:53,870
OK.

27
00:01:54,200 --> 00:01:55,640
So strange.

28
00:01:55,690 --> 00:02:08,600
All the calculations value all the calculations value and then this time I went to the instance this

29
00:02:08,600 --> 00:02:11,240
object with an antibody.

30
00:02:11,240 --> 00:02:17,250
OK so now let's actually declare order a boolean variable here.

31
00:02:17,900 --> 00:02:24,100
So here just type in Boolean OK first time.

32
00:02:24,860 --> 00:02:28,010
And then I want to assign the value to my variable.

33
00:02:28,010 --> 00:02:31,410
Now I want to actually create a variable of type status.

34
00:02:31,490 --> 00:02:38,420
OK so the member status is our own type that we actually created here in line 17 inside this main activity

35
00:02:38,420 --> 00:02:39,320
class.

36
00:02:39,320 --> 00:02:46,900
So remember that here we are actually creating a variable of type status and status is our own type

37
00:02:46,910 --> 00:02:49,210
that we actually created in line 17.

38
00:02:49,280 --> 00:02:49,750
OK.

39
00:02:49,820 --> 00:02:53,890
As you can see here we created an enum of type status.

40
00:02:53,960 --> 00:02:54,580
OK.

41
00:02:54,810 --> 00:02:56,730
And as you can see we can't.

42
00:02:56,840 --> 00:03:01,180
We can only assign these values to this in on here.

43
00:03:01,200 --> 00:03:02,550
OK not started yet.

44
00:03:02,670 --> 00:03:04,430
Proceed one last.

45
00:03:04,670 --> 00:03:08,190
So here I refer to the name of these type status.

46
00:03:08,210 --> 00:03:08,680
OK.

47
00:03:08,890 --> 00:03:09,790
This you know.

48
00:03:10,160 --> 00:03:20,990
And then I want to actually give a name to these valuable games that is like declaring or creating variables

49
00:03:21,080 --> 00:03:23,920
like integer variables or boolean variables here.

50
00:03:24,260 --> 00:03:28,490
You can actually create enough variables here as you can see.

51
00:03:28,520 --> 00:03:33,630
So the type of our variable is status and the name of a variable is game status.

52
00:03:33,650 --> 00:03:34,090
OK.

53
00:03:34,200 --> 00:03:40,050
Assignment operator and here I need to actually refer to the name of this status in arm.

54
00:03:40,310 --> 00:03:49,430
Ok but here again I can only assign these values to the variable status that last status that not started

55
00:03:49,430 --> 00:03:50,080
yet.

56
00:03:50,120 --> 00:03:52,630
Status that proceed status.

57
00:03:52,790 --> 00:04:01,490
That one here and here are some of the methods that you can actually use up in arms about it in this

58
00:04:01,490 --> 00:04:02,090
application.

59
00:04:02,090 --> 00:04:07,690
In this tutorial I just wanted to show you how you can actually assign values to these names.

60
00:04:07,780 --> 00:04:12,540
OK I'll talk more about enoughs in later tutorials.

61
00:04:12,860 --> 00:04:18,530
But for now I just want to show you how you can create declare and create incomes and use those names

62
00:04:18,560 --> 00:04:19,450
in your applications.

63
00:04:19,490 --> 00:04:23,120
Ok so here I want to actually actually assign the value.

64
00:04:23,120 --> 00:04:24,860
Not started yet.

65
00:04:24,920 --> 00:04:27,340
These are game status here.

66
00:04:27,470 --> 00:04:27,910
OK.

67
00:04:28,040 --> 00:04:34,850
So as you can see here we have A-type here status and we have a name and I assign this value status

68
00:04:34,850 --> 00:04:38,280
that not started yet to this variable here.

69
00:04:38,420 --> 00:04:38,910
OK.

70
00:04:39,110 --> 00:04:42,880
And remember this not stuff that yet is actually zero.

71
00:04:43,160 --> 00:04:43,790
OK.

72
00:04:44,120 --> 00:04:45,700
And it is the value zero.

73
00:04:45,810 --> 00:04:54,080
But for making it more readable for humans I decided to use this text instead of an integer around integer

74
00:04:54,080 --> 00:04:58,380
numbers so that you can actually see what's going on in our game.

75
00:04:58,460 --> 00:04:59,050
OK.

76
00:04:59,390 --> 00:05:08,970
And now I want to actually create an integer variable int and the name of our variable is points.

77
00:05:09,320 --> 00:05:09,900
OK.

78
00:05:09,980 --> 00:05:14,410
And then I need to actually put a semi-colon at the end of our statement here.

79
00:05:14,630 --> 00:05:15,130
OK.

80
00:05:15,230 --> 00:05:17,760
So now let's actually go inside this and create Mefford.

81
00:05:17,810 --> 00:05:23,380
And and here we can actually put in some quotes inside of these uncreate Muffat.

82
00:05:23,540 --> 00:05:24,100
OK.

83
00:05:24,260 --> 00:05:30,830
Now let's actually instantiate some of these objects that we actually created here inside this mean

84
00:05:30,830 --> 00:05:31,830
activity class.

85
00:05:31,940 --> 00:05:39,690
So here I can just refer to the name of this object TXI the calculations assignment operator.

86
00:05:39,980 --> 00:05:47,330
And then I can just cast this object to take three object find view by either the artist or the dots

87
00:05:47,720 --> 00:05:51,060
he makes the calculations OK.

88
00:05:51,860 --> 00:05:56,830
Again let's actually instantiate this IMT dice object.

89
00:05:56,870 --> 00:05:57,630
I m g.

90
00:05:57,710 --> 00:06:06,260
Dice assignment operator and then let's actually cast this object to our view object find view by the

91
00:06:06,640 --> 00:06:08,820
artist Id got.

92
00:06:09,090 --> 00:06:16,250
I m g so as you can see here the autocomplete feature here doesn't help us because we didn't assign

93
00:06:16,340 --> 00:06:19,640
any ID to the use of image image view here.

94
00:06:19,730 --> 00:06:25,520
So we need to actually assign an ID to this image view or AMG dice.

95
00:06:26,180 --> 00:06:26,730
OK.

96
00:06:26,930 --> 00:06:31,830
And then inside the main activity that you will find an insight this and create with it.

97
00:06:31,850 --> 00:06:33,970
I can't just referred to the name of this.

98
00:06:34,310 --> 00:06:35,940
I enjoy dice ID here.

99
00:06:36,020 --> 00:06:37,090
OK.

100
00:06:37,670 --> 00:06:40,940
And then let's actually to instantiate this button.

101
00:06:41,150 --> 00:06:41,390
OK.

102
00:06:41,390 --> 00:06:48,020
As you can see it's now showing us an error because we cast this object to a text view object we must

103
00:06:48,020 --> 00:06:50,000
cast this object to an image object.

104
00:06:50,020 --> 00:06:51,890
OK so this is very important.

105
00:06:51,900 --> 00:06:58,760
We can actually instantiate this between and start Game button here PTEN we start Game assignment operator

106
00:06:58,790 --> 00:07:03,220
and here if I actually test this object again to an image object.

107
00:07:03,500 --> 00:07:10,670
Let's see what it's ok find you by ID or that Id thought PTEN restart.

108
00:07:10,810 --> 00:07:16,470
As you can see here the compiler is complaining and we cannot cast this object to our own imagery or

109
00:07:16,480 --> 00:07:17,060
object.

110
00:07:17,260 --> 00:07:21,330
So we need to actually cast this object to about an object.

111
00:07:21,340 --> 00:07:24,460
And as you can see here now the error is gone.

112
00:07:24,490 --> 00:07:25,030
OK.

113
00:07:25,150 --> 00:07:36,630
And here let's actually create a text object that takes view to the game status and assignment operator.

114
00:07:36,790 --> 00:07:45,340
And here we need to actually cast this object to test object find view by ID or that ID that makes the

115
00:07:45,760 --> 00:07:47,180
gain status OK.

116
00:07:47,620 --> 00:07:53,810
And now outside of these uncreate Smurfette I want to actually create some other room if it's here OK.

117
00:07:54,100 --> 00:07:59,890
And the concepts that I am going to show you here is actually called encapsulations and this means in

118
00:08:00,310 --> 00:08:07,810
selecting your statements and your valuables in a one block of code and then use that block of code

119
00:08:08,080 --> 00:08:12,530
every time you need that block of code in your program.

120
00:08:12,600 --> 00:08:18,330
OK so let me show you how you can actually use in translation in your programs.

121
00:08:18,500 --> 00:08:19,130
OK.

122
00:08:19,330 --> 00:08:27,320
So here as you can see I am inside of these main activity class and outside of these uncreate Mefford.

123
00:08:27,760 --> 00:08:30,580
And here I want to actually create some if it's OK.

124
00:08:30,670 --> 00:08:37,210
So first of all I want to actually specify the access modifier private's and the return type of name

125
00:08:37,210 --> 00:08:42,640
if it is void and the name of my method is made.

126
00:08:43,510 --> 00:08:45,770
I am GITTOES invisible.

127
00:08:46,190 --> 00:08:46,690
OK.

128
00:08:46,870 --> 00:08:50,480
I am the dies in visible.

129
00:08:51,340 --> 00:08:51,910
OK.

130
00:08:52,180 --> 00:08:56,000
And then I need to actually put in a pair of round brackets here after my Meffert name.

131
00:08:56,290 --> 00:09:01,560
And then I need to actually open and close this method by using these curly braces.

132
00:09:01,630 --> 00:09:17,200
So inside of this Smurfette I can just type in IMJ dice that sets visibility view OK dot invisible as

133
00:09:17,200 --> 00:09:18,190
you can see here.

134
00:09:18,550 --> 00:09:25,840
I created MFH here and inside of this never I just put one line of code here one statement or MGD that

135
00:09:25,840 --> 00:09:28,810
said visibility view that invisible.

136
00:09:28,810 --> 00:09:36,100
So when ever that I call the Smurfette in my program inside of any Meffert such as this uncreate if

137
00:09:36,120 --> 00:09:41,080
it is going actually going so I tried this method OK.

138
00:09:41,260 --> 00:09:46,470
And then it's going to execute this line of code here and then it's gonna make that IMT dies invisible.

139
00:09:46,480 --> 00:09:55,300
So this actually creates another MF With private Voyt and the name of my Minford this time is make between

140
00:09:56,410 --> 00:10:03,170
restart invisible and then I need to actually put in a pair of round brackets here after my name.

141
00:10:03,400 --> 00:10:07,020
And then I need to actually open and close my Meffert by using these curly braces.

