// CMSC 131 Lecture Program /* This example introduces comments and conditional statements * */ import javax.swing.*; public class IfExample2 { public static void main(String[] args) { String boss = "John Sanders"; String name, reply; name = JOptionPane.showInputDialog("Enter your name"); // Notice you can also declare a variable here boolean nameEqual; nameEqual = name.equals(boss); if (nameEqual) { reply = "Hello Boss"; } else { reply = "Hi " + name; } JOptionPane.showMessageDialog(null, reply); System.exit(0); } }