The value of Wahls is outputted to the console.
OK.
So this false value is the last value that be assigned to this value.
Now I want to give you some examples about Constance.
OK.
If the value should never change during our programs run time you can use a type of variable called
a constant.
OK.
To declare a constant use the final keyboard before the variable declaration and actually assign an
initial value to that variable.
OK.
So now you want to show you some real examples about constants.
OK.
So here I declare an integer variable.
OK.
As you can see and I assign a value to this variable.
So now I want to output the value of this roudy about to the console.
OK.
System that out that princeling and then insider practice's just referred to the name of this value.
OK.
And run your project as you can see the value of Pertti is now out with it to the console.
OK.
So now I want to actually assign another value to this variable.
For example number 50.
OK.
So now I want to output the value of this variable to the console system that out that adrenaline and
an inside Apprentice's just referred to the name of this variable.
Ok so if I run my project now as against it's going to output the value of 50 to the console.
OK.
So now as I said earlier to declare a constant you need to actually put the final keyboard before the
variable declaration and include an initial value for that value.
OK.
So here if I actually put the final keyword before the variable declaration as you can see is now showing
me an error on the line 77 because this variable is a constant.
And we cannot add another value to a constant.
OK so this is a very important point about constants.
So we must delete this line of code here.
And as you can see the error is now gone.
And if I run my project now as you can see it outputs only the value for the console.
OK so now if I want to actually add another value to this variable as you can see it is now again showing
us an error.
And it doesn't allow us to add another value to this variable because this variable is a constant.
And now let me give you another example.
OK.
So first we put in the final keyboard and then the data of are valuable and then we get our valuable
a name.
OK.
And then we assign a value to our value.
Okay.
And then I want to actually output the value of this variable to the console.
So system that out that's being stolen.
And then inside Apprentice's just revert to the name of that variable and a comment out these lines
of code and then run my project as you can see it outputs the value of this variable to the console.
OK.
So now if you want to actually assign another value to this variable OK.
It doesn't allow us to do it because we cannot add another value to a constant.
OK.
And if you for example delete that final keyword as you can see here.
Now the error is gone.
OK.
And if I put back that final keyboard as you can see here now it's doing me an error again because we
can't assign another value to a constant.
OK so that's enough for this tutorial.
We will be using these primitive data types later in the course when we are actually creating Java and
Android applications.
OK.
So ask any questions that you want about these concepts.
You can either message me or you can create a discussion in the course.
And thanks for watching and I'll see you in the next tutorial.