/******************************************************* * Author: Eric Heim * Date Created: 5/31/2011 * Course: CS0007 * Description: Shows the basic functionality of * various relational operators *******************************************************/ public class RelationalOperators { public static void main(String[] args) { int x = 5, y = 1; if(x < y) System.out.println("x is less than y"); if(x > y) System.out.println("x is greater than y"); if(x == y) System.out.println("x is equal to y"); if(x != y) System.out.println("x is not equal to y"); if(x >= y) System.out.println("x is greater than or equal to y"); if(x <= y) System.out.println("x is less than or equal to y"); if(!false) System.out.println("Not false is true"); if(x + y > x - y) System.out.println("x + y is greater than x - y"); } }