·  JAVA – Syntax – Operators – Conditional

 

- Info:

  - This tutorial shows how to use Conditional Operators in JAVA.: && || !.

  - They are used to create complex logical structures from individual Comparison Operations.

 

- Procedure:

  - Create JAVA Console Application Test.java

 

    Test.java

    public class Test {

   

      public static void main(String[] args) { 

        

        char left  = 65;

        long right = 70;       

   

        if ( left> 50 && right==70 ) { System.out.println("left >50 AND right==10"    ); }

        if ( left!=4  || right> 90 ) { System.out.println("left!=50 OR  right> 90"    ); }

        if (          !  (left==80)) { System.out.println("left is  NOT equal to 80"  ); }

        

      }

   

    }