Advertisement
heysoul_sisypus

switch break (string)

Feb 1st, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.28 KB | None | 0 0
  1. Scanner scan =new Scanner (System.in);
  2.         System.out.print("Emter col R/Y/B: ");
  3.         String c=scan.nextLine();
  4.         c=c.toUpperCase();
  5.         switch (c)
  6.         {case "R": System.out.println("Red");
  7.         break;
  8.         default: System.out.println("Out of range");}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement