daily pastebin goal
21%
SHARE
TWEET

Untitled

a guest Jan 17th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top