// exj5.java example file iteration, if then else public class exj5 // class name same as file name { public exj5() // constructor same as class name { System.out.println("exj5.java running"); double x = 2.0; // declare test variable int i = 3; if(x < 3.0) // < > <= >= == != compare operations { System.out.println("compare < > <= >= == != x="+x); } if(x > 3.0 || i == 3 && i > 2) // || is or, && is and { System.out.println("logic || is or, && is and i="+i); } if( x > 3.0) { System.out.println("x > 3.0"); } else if(i < 3) // optional { System.out.println("i < 3"); } else // optional, get here if none of the above true { System.out.println("none of the above"); } // end if optional comment } // end constructor exj5 optional comment public static void main (String[] args) { new exj5(); } } // end class exj5 optional comment