fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. String stringToSwitch = "AB";
  10. switch (stringToSwitch) {
  11. case "a":
  12. System.out.println("a");
  13. break;
  14. case "AB":
  15. System.out.println("AB"); //the code goes here
  16. break;
  17. case "B":
  18. System.out.println("B");
  19. break;
  20. default:
  21. break;
  22. }
  23. }
  24. }
Success #stdin #stdout 0.08s 54648KB
stdin
Standard input is empty
stdout
AB