试题详情
单项选择题 1. public class SwitchTest {  2. public static void main (String []args)  {  3. System.out.PrintIn(“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. }     What is the output from line 3?()  

A、 Value = 3

B、 Value = 4

C、 Value = 5

D、 Value = 6

E、 Value = 7

F、 Value = 8

  • F
  • 关注下方微信公众号,在线模考后查看

热门试题