OK.
But if both of these boolean expressions are true or if both of these boolean expressions are far less
this logical operator produces a false value.
OK.
So for example if I want to actually change this value to something else for example.
Now that is less than or equal to 69.
And if I change this value for example to 78 as you can see here now it's can actually again output
the value true to the console.
So let's actually run our project as you can see it's not actually the value tool is now output to the
console.
Because this expression as you can see here this expression evaluates to TRUE.
OK.
As you can see the value of the non-fun valuable is less than sixty nine.
OK so the value of the number one variable is 59 and 59 is less than 69.
So this expression evaluates to TRUE.
OK on this expression here.
Evaluate to false OK the value of the number one variable is not greater than 78.
OK.
59 is not greater than 78 59 is less than 78.
So this expression here evaluates to false as a result the value of the entire expression evaluates
to true.
Now we're not talking about another type of logical operator the not logical operator OK not logical
operator so.
So in order to use the not logical operator in our Java code views design in our code.
OK.
Just place and shift key plus the number one key on your keyboard.
OK.
As you can see.
So in order to use the not logical operator in your Java code we use this symbol this logical operator
reverses the value of the boolean expression in the same way that a minus sign reverses the positive
or negative sign on a number.
OK so now let me show you some real examples.
OK.
So the data type of my variable is int and the name of my variable is first number.
OK.
And then I want to assign a value to my variable.
For example 25.
So now I want to create another boolean variable so the data type of my variable is boolean and the
name of multivariable is.
For example can get our job.
OK.
And then I assign a value to my valuable for example follows.
And then at the end of my statement I need to put in a semi-colon OK.
So now I want to change the value of these boolean value here.
So I just need to refer to the name of my variable and get a job and then I want to assign a value to
my variable.
So here I want to actually use that expression.
OK.
I just need to put in prentices and that inside Apprentice's I can with the expression.
OK.
So.
So I want to actually refer to the name of my first number variable in order to read its value.
So as you can see here I use the capital T here.
This is wrong.
Ok I need to use the lowercase letter.
OK because this letter is part of my first word.
OK.
So here I need to refer to the name of my variable in order to read its value first number.
Now I want to tell the computer that first number must be less than 50.
OK.
And then at the end of my statement I need to put in a semi-colon OK.
So now I ventured out with the value of this variable to the concert system that out that princeling
and and inside the apprentice's I need to refer to the name of my variable I can get a job.
OK.
And then 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 outputs this value to the console.
True.
OK this value is the value of this can get a job value of it.
OK so this expression here evaluates to TRUE.
Why.
Because the value of the first number value is 25 and 25 is less than 50.
OK so this expression evaluates to true.
So now I want to use the not operator here.
So in order to use the not operator in our code we need to put the not operator before the boolean expression.
So as you can see this is our boolean expression.
Now I want to put another operator here.
So now let me actually run my project as you can see this value is now false.
OK the value of false is now out with her to the console.
So the not operator reverses the value of a boolean expression in the same way that the minus sign reverses
the positive or negative sign on a number.
OK as you can see not operator reverses the value of this expression.
So for example as you can see first number is less than 50.
So this expression evaluates to TRUE OK but this not operator here.
Rivera says that the true value to false value.
OK.
And that's why you see the first value is output to the console.
So for example if I now change this value here to 20 as you can see.
So now let me actually run my project and see what happens.
The value of that is output to the console is true.
So what's going on here.
So let me explain to you once again as you can see this expression here evaluates to false the value
of the first number variable is 25.
OK so 25 is not less than 20.
So the value of this entire expression evaluates to false but this not operator here that reverses the
value of a boolean expression.
Ok this not operator reverses that false value to true value.
True Value.
So that's why we see the true value here in the console.
OK.
So this is very important.
So now if I for example change this number to 50.
Now let me run my project.
So as you can see the value falls out with at the console.
OK first number is less than 30.
So this expression evaluates to TRUE okay and does not operate operator reverses that true value to
false value.
So now let me actually change this number two for example 10.
So as you can see here the value true is outputted to the console.
Okay.
So this expression here evaluates to false.
Okay.
The value of this first number variable 25 is not less than 10.
Okay.
So this expression evaluates to false and this operator reverses that false value to true value.
Okay.
So that's why we see these are true value in the console Okay.
So I think that's enough for this theater.
And if you have any question please post the discussion in the course.
So thank you very much for watching this tutorial and I'll see you in the next tutorial.