How do I loop a switch Statement?
I need to loop it so that when a user inputs a 1, 2, 3, or anything other than a 4 it restarts, and when the user types in a 4 the program terminates.
import javax.swing.JOptionPane ; public class Input123 { public static void main(String[] args) { int n; n = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter a 1, 2, 3, or 4" )) ; { switch(n) { case 1: case 2: case 3: System.out.println("Good Job!") ; break ; case 4: System.out.println("Pragram Terminated") ; break ; default: System.out.println("No such Parameter") ; } } }