Private static final INT and this time the name of my constant is Panter and then I assigned the value
12 to my constant here.
OK.
So hopefully that makes sense and then it's actually OK.
Now let's actually declare some objects here inside of this main activity class here.
OK.
So first of all I want to declare an object of type text.
View.
Takes view he makes the calculations and I put a semi-colon here.
And remember we are here actually declaring an object of type text.
View we do not instantiate this object yet let's actually declare another object image view.
OK.
I m g dice semicolon button.
OK.
And between restart game let me actually explain again.
We are here only declaring these objects and these are objects actually do not refer to any valid object
yet these objects just referred to a null object inside the memory.
These activities are only references.
OK these are only different references and these are only actually referring to another object inside
the memory because we do not actually instantiate these objects yet.
And if you want to use these objects inside this and create Meffert or any other methods you're going
to actually get some errors and you end up with with an exception.
And your application may crash.
OK so you need to actually always make sure that you are instance creating your objects.
OK so but here I just want to declare these objects.
OK.
So strange.
All the calculations value all the calculations value and then this time I went to the instance this
object with an antibody.
OK so now let's actually declare order a boolean variable here.
So here just type in Boolean OK first time.
And then I want to assign the value to my variable.
Now I want to actually create a variable of type status.
OK so the member status is our own type that we actually created here in line 17 inside this main activity
class.
So remember that here we are actually creating a variable of type status and status is our own type
that we actually created in line 17.
OK.
As you can see here we created an enum of type status.
OK.
And as you can see we can't.
We can only assign these values to this in on here.
OK not started yet.
Proceed one last.
So here I refer to the name of these type status.
OK.
This you know.
And then I want to actually give a name to these valuable games that is like declaring or creating variables
like integer variables or boolean variables here.
You can actually create enough variables here as you can see.
So the type of our variable is status and the name of a variable is game status.
OK.
Assignment operator and here I need to actually refer to the name of this status in arm.
Ok but here again I can only assign these values to the variable status that last status that not started
yet.
Status that proceed status.
That one here and here are some of the methods that you can actually use up in arms about it in this
application.
In this tutorial I just wanted to show you how you can actually assign values to these names.
OK I'll talk more about enoughs in later tutorials.
But for now I just want to show you how you can create declare and create incomes and use those names
in your applications.
Ok so here I want to actually actually assign the value.
Not started yet.
These are game status here.
OK.
So as you can see here we have A-type here status and we have a name and I assign this value status
that not started yet to this variable here.
OK.
And remember this not stuff that yet is actually zero.
OK.
And it is the value zero.
But for making it more readable for humans I decided to use this text instead of an integer around integer
numbers so that you can actually see what's going on in our game.
OK.
And now I want to actually create an integer variable int and the name of our variable is points.
OK.
And then I need to actually put a semi-colon at the end of our statement here.
OK.
So now let's actually go inside this and create Mefford.
And and here we can actually put in some quotes inside of these uncreate Muffat.
OK.
Now let's actually instantiate some of these objects that we actually created here inside this mean
activity class.
So here I can just refer to the name of this object TXI the calculations assignment operator.
And then I can just cast this object to take three object find view by either the artist or the dots
he makes the calculations OK.
Again let's actually instantiate this IMT dice object.
I m g.
Dice assignment operator and then let's actually cast this object to our view object find view by the
artist Id got.
I m g so as you can see here the autocomplete feature here doesn't help us because we didn't assign
any ID to the use of image image view here.
So we need to actually assign an ID to this image view or AMG dice.
OK.
And then inside the main activity that you will find an insight this and create with it.
I can't just referred to the name of this.
I enjoy dice ID here.
OK.
And then let's actually to instantiate this button.
OK.
As you can see it's now showing us an error because we cast this object to a text view object we must
cast this object to an image object.
OK so this is very important.
We can actually instantiate this between and start Game button here PTEN we start Game assignment operator
and here if I actually test this object again to an image object.
Let's see what it's ok find you by ID or that Id thought PTEN restart.
As you can see here the compiler is complaining and we cannot cast this object to our own imagery or
object.
So we need to actually cast this object to about an object.
And as you can see here now the error is gone.
OK.
And here let's actually create a text object that takes view to the game status and assignment operator.
And here we need to actually cast this object to test object find view by ID or that ID that makes the
gain status OK.
And now outside of these uncreate Smurfette I want to actually create some other room if it's here OK.
And the concepts that I am going to show you here is actually called encapsulations and this means in
selecting your statements and your valuables in a one block of code and then use that block of code
every time you need that block of code in your program.
OK so let me show you how you can actually use in translation in your programs.
OK.
So here as you can see I am inside of these main activity class and outside of these uncreate Mefford.
And here I want to actually create some if it's OK.
So first of all I want to actually specify the access modifier private's and the return type of name
if it is void and the name of my method is made.
I am GITTOES invisible.
OK.
I am the dies in visible.
OK.
And then I need to actually put in a pair of round brackets here after my Meffert name.
And then I need to actually open and close this method by using these curly braces.
So inside of this Smurfette I can just type in IMJ dice that sets visibility view OK dot invisible as
you can see here.
I created MFH here and inside of this never I just put one line of code here one statement or MGD that
said visibility view that invisible.
So when ever that I call the Smurfette in my program inside of any Meffert such as this uncreate if
it is going actually going so I tried this method OK.
And then it's going to execute this line of code here and then it's gonna make that IMT dies invisible.
So this actually creates another MF With private Voyt and the name of my Minford this time is make between
restart invisible and then I need to actually put in a pair of round brackets here after my name.
And then I need to actually open and close my Meffert by using these curly braces.