Now if you want to actually create another variable for example in that age and then I put in an assignment
operator here and then I can assign a value to my valuable for example 35.
OK.
And then at the end of my statement I need to put in a semi-colon.
So now we want to output the value of this variable to the console to make sure that it works OK.
And then inside Apprentice's I need to refer to the name of my variable and then at the end of my statement
I need to put in a semi-colon OK.
So now if I run my project as you can see this value is now output to the console.
OK this value is the value of my age variable and in line 41 I decided to output the value of my age
variable to the console.
OK.
So now you want to actually create another variable boolean and the name of my variable would be can
play football.
OK.
And then I can assign a value to my variable here.
For example false or true.
OK.
And then at the end of my statement I need to put in a semicolon OK.
So now if you want to output the value of this variable to the console I just need to type in her system
that out that print's land and then inside the prentices I need to refer to the name of my valuable
Channa play football.
And at the end of my statement I need to put in a semi-colon OK.
So now if I run my project as you can see it outputs the value of these can play with Paul variable
to the console.
OK so now I want to actually use the all logical operator here for my expressions.
OK.
I want to actually assign another value to my boolean value.
So I just need to refer to the name of my value.
Well OK.
And then you want to assign a value to my value of it.
So here I want to actually combine expressions together.
So the first expression is for example the age must be less than 50.
OK.
And then I use the OR operator press on shift key plus the slash key on your keyboard two times.
So as you can see this is the or logical operator that we use in Java.
OK.
And now I want to actually create an other expression.
So I just put in practices here and then inside the practices I tell the computer that the age must
be greater than 20.
OK.
And then at the end of my statement I need to put in a semi-colon OK.
So now if I want to output the value of this variable to the console Let's see what happens.
System that out that print and and an inside Apprentice's.
I just need to refer to the name of my variable can play football.
OK.
And then at the end of my statement I need to put in a semicolon.
OK.
So if you run my project now as you can see it outputs this value to the console so they don't actually
comment out these lines of code here.
And if I run my project again as you can see it outputs the value of my hand play football variable
to the concert.
So as you can see here this expression here evaluates to TRUE.
Why.
Because the value of the H variable is less than 30.
So as you can see here the value of the age variable is 45.
OK.
And here I am telling the computer that the value of the H variable must be less than 30.
In order to evaluate the value of this expression true true.
OK.
And here I am using the OR operator OK.
As you can see here this expression combines two comparison expressions.
H must be less than 50 or H must be greater than 20.
OK.
So if either of these expressions is true the boolean value true is assigned to the variable can play
football.
OK.
Only if both of these expressions are false is the value of false assigned assigned to play football.
You bet.
OK so now let me actually show you the result as you can see here the value true is now out with it
to the console.
OK.
So now let me actually explain what's going on here.
OK.
In Line 50 we created a value but AK ain't age.
And to be assigned a value to a variable.
OK.
In line 52 we created another variable can play football with the boolean data type and we assigned
the value true to our value but.
And in line 35 I decided to change the value of the can play football valuable.
OK.
So as you can see here in line first if I put a combination of expressions as you can see here as a
value for my variable.
OK.
So the first expression is 8 must be less than 30.
OK the value of the H variable is 35.
OK.
As you can see here.
So I am telling the computer that the value of the H variable must be less than 50.
In order to evaluate the value of this expression to true and here I am using the OR operator or the
value of the A2 variable must be greater than 20.
OK.
So as you can see here the value of the H variable is 55 35 is not less than 40.
So this expression evaluates to false.
Ok so now let me actually create a comment here.
This expression here evaluates to false.
Why.
Because the value of the age variable is greater than 50.
OK so false.
OK.
And here I am using the OR operator or.
OK.
And the value of the expression evaluates to TRUE.
OK.
Because the value of the age of the bell is greater than 20.
OK.
The value of the age variable is 45 and 35 is greater than 20.
So the value of this expression evaluates to true and because I am using the old operator here if either
of these expressions is true.
OK.
The boolean value truth is assigned to the variable can play football.
OK.
So this expression evaluates to TRUE.
OK.
As a result the entire expression evaluates to true and that's true value will be assigned to this can
play football valuable.
OK.
So if I for example change this value to 40 and if I run my project now as you can see it's going to
output the value of this variable to the council for us.
OK.
This fall this is the value of this can can play football valuable.
So as you can see here this is this expression evaluates to false OK or this expression again evaluates
to false as a result.
The entire expression evaluates to false and that false value is assigned.
Two can play football very well.
And here as you can see this is that value OK.
And here if I for example change this value to 42 as you can see here this expression now evaluates
to TRUE.
OK because the value of this age variable is now less than 42.
OK.
45 is less than 42.
So this expression evaluates to true or as you can see here.
Again I am using the OR operator the all logical operator here.
Here as you can see this expression evaluates to false.
So if I on my project as you can see because this expression evaluates to true that's enough.
So now you can see here this expression evaluates to TRUE.
OK all this expression evaluates to false.
OK.
So as you can see if I run on my project as you can see this value is now out with it to the console
because when you are using an all logical operator between your expressions.
OK.
It is enough that only one of your expressions evaluate to true.
OK.
And as a result the entire expression evaluates to true.
Now let me actually change this number two for example for the fourth.
OK.
Now as you can see this expression evaluates to true age must be greater than the first four.
So as you can see here the value of my age variable is 55.
And here I am telling the computer that the value of the age value of it must be greater than 44 in
order to evaluate the value of this expression neutral.
OK.
And this expression again evaluates to true.
And if I run my project now as you can see again it's going to output this value to the console.
OK.
But when you are using the and operator there is a different story.
OK.
All of your expressions must evaluate to true in order to evaluate the entire expression.
True.
OK that's enough for this or logical OPERATOR OK.