1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
outer: while(true) { while(true) { i++; System.out.println("i = " +i); if(i == 1) { System.out.println("continue"); continue; } if(i == 3) { System.out.println("continue"); continue outer; } if(i == 5) { System.out.println("break"); break; } if(i == 7) { System.out.println("break"); break outer; } } }
int a = 1; switch(a) { case 1: System.out.print(a); case 2: System.out.print(a+1); }
|