关于以下程序哪条叙述正确?
1. int j = 2;
2. switch ( j ) {
3. case 2:
4. System.out.println ("value is two");
5. case 2 + 1:
6. System.out.println ("value is three");
7. break;
8. default:
9. System.out.println("value is " + j);
10. break;
11. }
A. 第5行的表达式不合法;
B. 变量j是可接受的,switch中表达式可以是byte, short, int,或long的任何类型;
C. 输出为value is two
D. 输出是value is two 后跟value is three
E. 输出是value is two 后跟 value is 2
答案说明:本题目答案来自网络整理或转载,最终答案请以官网为准。
答 案:D