题目内容

下面的Java程序运行结果是?switch (5) {default:System.out.println(5);break;case 0:System.out.println(0);break;case 1:System.out.println(1);break;case 2:System.out.println(2);break;}

A. 0
B. 1
C. 2
D. 5

查看答案
更多问题

下列的Java程序执行结果是?switch (5) {default:System.out.print(5);case 0:System.out.print(0);case 1:System.out.print(1);break;case 2:System.out.print(2);break;}

A. 1
B. 5
C. 501
D. 0

下列Java程序运行后,y的值是?int x = 2;int y = 3;switch (x) {default:y++;case 3:y++;break;case 4:y++;}

A. 2
B. 3
C. 4
D. 5

下列Java程序运行后,y的值是?int x = 2;int y = 3;switch (x) {default:y++;case 3:y++;case 4:y++;}

A. 2
B. 3
C. 5
D. 6

分析下列Java代码的执行结果是?int i = 2;switch (i) {case 0:System.out.print("0");case 1:System.out.print("1");case 2:System.out.print("2");case 3:System.out.print("3");break;default:System.out.print("default");}

A. 01
B. 12
C. 23
D. default

答案查题题库