/* Conditional1.java CIS 160 David G. Klick 2004-09-17 Demonstrates the conditional operator ?: */ import javax.swing.JOptionPane; public class Conditional1 { public static void main(String[] args) { String strIn; int num1, num2, max; strIn = JOptionPane.showInputDialog("Please enter an integer"); num1 = Integer.parseInt(strIn); strIn = JOptionPane.showInputDialog("Please enter another integer"); num2 = Integer.parseInt(strIn); max = num1 > num2 ? num1 : num2; JOptionPane.showMessageDialog(null, "The largest number you entered was " + max); System.exit(0); } }