So first for example I want to create somebody.
OK.
In the name of my variable with B X and then I assign a value to my valuable and at the end of my statement
I need to put in a semicolon.
OK.
So first I want to output the value of this variable to the console to make sure that it's working.
Print line and inside the prentices I just need to refer to the name of my variable and at the end of
my statement I need to put in the same code on OK so if I write on my project as you can see it's going
to output this value to the console.
This is the value of the x variable here.
OK.
Now I want to actually create another variable here ain't Y.
And I want to assign a value to my value but for example x plus plus and at the end of my statement
I need to put in a semicolon.
So here as you can see so here I can see why it is given the value of the x variable before it is incremented.
OK.
Because I used this postfix operator here the value of these x variable is going to be assigned to the
rivalry at Bell and then the value of this variable will be incremented.
OK so if I actually output the value of this very variable to the console system that out that print
land and the inside Apprentice's I just need to refer to the name of one variable.
So first when I actually put in some text here this is the value of my voice value.
OK.
And then I need to refer to the name of my variable.
Why.
OK.
And at the end of my statement I need to put in a semi-colon.
So if I run my project now as you can see it's going to actually output this value to the console.
This is the value of my very valuable 42.
OK.
Even though I use these plus plus operator on my variable name it didn't actually assign the incremented
value to my wife value it because I use this postfix operator on my variable name first.
It actually assigned the value of this valuable to my view variable and then it incremented the value
of this x variable by 1.
As you can see here.
OK.
If I actually want to output the value of this variable to the console system that out that printed
on
and then inside the prentices I just need to refer to the name of my variable.
So I just put in some text here.
This is the value of my
X Y Z and after incrementing it's value OK.
It's value by what.
OK.
So here I use the plus operator in order to concatenate this text with my variable name.
So I just put in the variable name here and at the end of my statement I need to put in a semi-colon.
OK.
So now if you run my project as you can see it's going to output this value here to the console.
OK this is the value of my x variable after incrementing its value by 1 OK for free.
This is the value of my x variable.
After incrementing its value by 1 in this line of code here OK I use the postfix operator on my variable
name here.
OK.
And because I used the post this operator on my variable name for it it's going to actually assign the
value of this variable which is 42 to my view variable here and then it's gonna actually increment the
value of this variable which is 42 by 1 and the value of this variable will be 40 free.
So in this line of code in line 71 I decided to output the value of this valuable to the console in
order to show you that the value of the x value but is now incremented.
OK.
So now if I actually use the prefix operator on my variable name here minus minus x.
Ok so now let's actually run our project and see what happens.
So as you can see here the value of my very valuable is 41.
Okay.
And the value of my x variable is 41.
As you can see here.
OK.
So because I use the prefix operator here first is going to actually decrement the value of this x variable
here which is 42 by 1 and then it's gonna assign that value to my view variable here.
So as you can see in the console the value of my right the value of my value variable is 41.
OK.
So in line 71 as you can see here the value of my x variable is 41.
OK because of this line of code here as you can see.
OK.
So that's it for actually incrementing and decrementing in Java.
OK.
So if you have any questions about these concepts that are actually taught to you in this lecture please
post a discussion in the course and ask your questions and then I'll answer all of your questions.
OK.
So thank you very much for watching this tutorial and I'll see you in the next tutorial.