Guest User

Untitled

a guest
Jan 17th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SwitchMenu {
  4.  
  5. public static void main(String[] args) {
  6.  
  7. Scanner Input = new Scanner(System.in);
  8.  
  9. System.out.println("Choose a class\n1: Warrior\n2: Rogue\n3: Wizard");
  10.  
  11. int choice = Input.nextInt();
  12. switch (choice) {
  13. case 1:
  14. System.out.println("You picked warrior.");
  15. break;
  16. case 2:
  17. System.out.println("You picked Rogue.");
  18. break;
  19. case 3:
  20. System.out.println("You picked Wizard.");
  21. break;
  22. default:
  23. System.out.println("That was not a valid choice.");
  24. break;
  25.  
  26. }
  27. Input.close();
  28. }
  29. }
Add Comment
Please, Sign In to add comment