Speed up development with full-stack environments for every branch.

Learn More

Java Operators - Relational operators

Forked from Basic Java Example.

139 Runs 524 Views 155 Copies
Saved

Saved

gtsolutions 373

gtsolutions
published 4 years ago

    /*
    * Java Operators - Relational operators
    */
    
    public class HelloWorld {
      public static void main(String args[]) {
         int a = 10;
         int b = 20;
         //check if are equal
         System.out.println("a == b = " + (a == b) );
         //check if are different
         System.out.println("a != b = " + (a != b) );
         //check if a is greater than b
         System.out.println("a > b = " + (a > b) );
         //check if a is smaller than b
         System.out.println("a < b = " + (a < b) );
         //check if b is greater or equal than a
         System.out.println("b >= a = " + (b >= a) );
         //check if b is smaller or equal than a
         System.out.println("b <= a = " + (b <= a) );
      }
    }
    
    
    
    Please login/signup to get access to the terminal.

    Your session has timed out.

    Dismiss (the page may not function properly).