在JAVA中,有如下代码:
1 public class SwitchTest {
2 public static void main (String[] args) {
3 System.out.println ("value =" + switchIt(4));
4 }
5 public static int switchIt(int x) {
6 int j = 1;
7 switch (x) {
8 case 1: j++;
9 case 2: j++;
10 case 3: j++;
11 case 4: j++;
12 case 5: j++;
13 default:j++;
14 }
15 return j + x;
16 }
17}第 3 行的输出结果是什么?( )
Value =3
Value =4
Value =5
Value =6
Value =7
Value =8
switch-case语句中,不做break会继续执行