//NumberIf.java import javax.swing.*; public class NumberIf { public static void main (String[] args) { String input; int num1; int num2; input = JOptionPane.showInputDialog("Enter first integer"); num1 = Integer.parseInt(input); input = JOptionPane.showInputDialog("Enter second integer"); num2 = Integer.parseInt(input); //three-way branch. is really nested if statement //but is easier to think of as a multiway branch if (num1 == num2) JOptionPane.showMessageDialog( null, "they equal!"); else if (num1 > num2) JOptionPane.showMessageDialog( null, "first is bigger than second"); else JOptionPane.showMessageDialog( null, "first is smaller than second"); } } /* this would be syntax error: else (num1 > num2) add: relation="equals"; etc */