Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SwitchMenu {
- public static void main(String[] args) {
- Scanner Input = new Scanner(System.in);
- System.out.println("Choose a class\n1: Warrior\n2: Rogue\n3: Wizard");
- int choice = Input.nextInt();
- switch (choice) {
- case 1:
- System.out.println("You picked warrior.");
- break;
- case 2:
- System.out.println("You picked Rogue.");
- break;
- case 3:
- System.out.println("You picked Wizard.");
- break;
- default:
- System.out.println("That was not a valid choice.");
- break;
- }
- Input.close();
- }
- }
Add Comment
Please, Sign In to add comment