waltermilner

Untitled

Nov 8th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. public class Test {
  2.  
  3.   final static short x = 2;
  4.  
  5.   public static void main(String args[]) {
  6.  
  7.     for (int z = 0; z < 4; z++) {
  8.       System.out.println("z = " + z);
  9.       switch (z) {
  10.         case x:
  11.           System.out.println(0);
  12.         case x - 1:
  13.           System.out.println(1);
  14.         case x - 2:
  15.           System.out.println(2);
  16.       }
  17.     }
  18.   }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment