fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7.  
  8. class Ideone{
  9.  
  10. public static void main (String[] args) throws java.lang.Exception {
  11. int[] test = {0,1,5,23,24};
  12. for (int t: test) {
  13. System.out.println(String.format("Running test: %s", t));
  14. switch(t) {
  15. case 0:
  16. System.out.println(String.format("Match: %s", 0));
  17. case 23:
  18. System.out.println(String.format("Match: %s", 23));
  19. default:
  20. System.out.println(String.format("Match: %s", "default"));
  21.  
  22. }
  23. }
  24. }
  25. }
Success #stdin #stdout 0.1s 50476KB
stdin
Standard input is empty
stdout
Running test: 0
Match: 0
Match: 23
Match: default
Running test: 1
Match: default
Running test: 5
Match: default
Running test: 23
Match: 23
Match: default
Running test: 24
Match: default