public class IfDemo1 { public static void main(String[] args) { /* boolean b; b = true; b = false; // Dangerous assignment in an if statement boolean condition // just say no. Use == in boolean conditions if (b = true) { System.out.println("inside then branch"); } */ int iRead; // read a value from user iRead = IO.readInt("Your int > "); /* // if value is > 100 if (iRead > 100) { // tell the user it is > 100 System.out.println("Your number is 100"); } // else tell the user it is <= 100 else { System.out.println("Your number is <= 100"); } */ // if value is > 100 if (iRead > 100) { // tell the user it is > 100 System.out.println("Your number is > 100"); } // otherwise else { // if it is == 100 if (iRead == 100) { // tell them it is 100 System.out.println("Your number is 100"); } // otherwise else { // tell them it is 100 System.out.println("Your number < 100"); } } // tell the user we are done System.out.println("All done."); } }