Logical operators are used to combine boolean values that can be only TRUE or FALSE.
This way they provide a method to direct program flow depending on the outcome.
Logical
//TEST VARIABLES.
char left = 65;
long right = 70;
//LOGICAL OPERATORS.
if ( left> 50 && right==70 ) { System.out.println("Both are true" ); } // AND
if ( left> 50 AND right==70 ) { System.out.println("Both are true " ); } // AND
if ( left!=4 || right> 90 ) { System.out.println("At least one is true" ); } // OR
if ( left!=4 OR right> 90 ) { System.out.println("At least one is true " ); } // OR
if ( left!=4 XOR right> 90 ) { System.out.println("Only one is true ); } // XOR
if ( ! (left==80)) { System.out.println("left is NOT equal to 80" ); } // NOT
if ( NOT (left==80)) { System.out.println("left is NOT equal to 80" ); } // NOT