下列程序执行后,r的值是?char ch = '8';int r = 10;switch (ch + 1) {case '7':r += 3;case '8':r += 5;case '9':r += 6;default:r += 8;}
查看答案
下面的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