package class3_3_SwitchStatement; // Josiah Yoder, MSOE, 24 September 2015 import javax.swing.*; public class SwitchStatement { public static void main(String[] args) { String input = JOptionPane.showInputDialog(null, "What do you want? Enter a digit from the options below.\n" + "1: Apples\n" + "2: Oranges"); int choice = Integer.parseInt(input); String fruit; switch(choice) { case 1: fruit = "Apples"; case 2: fruit = "Oranges"; break; default: fruit = "neither apples or oranges"; break; } JOptionPane.showMessageDialog(null, "You chose"+fruit); } }