可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

public class SwitchTest&ens


public class SwitchTest {   public static void main (String args) {   System.out.PrintIn(“value =” +switchIt(4));   }   public static int switchIt(int x) {   int j = 1;   switch (x) {   case 1: j++;   case 2: j++;   case 3: j++;  case 4: j++;   case 5: j++;   default:j++;   }   return j + x;   }   }   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
参考答案
参考解析:
分类:SCJP程序员认证考试题库