下列代码段执行后, season的值为()int month = 3;String season = "";switch (month) { case 12: case 1: case 2: season = "winter"; break; case 3: case 4: case 5: season = "spring"; break; case 6: case 7: case 8: season = "summer"; break; case 9: case 10: case 11: season = "autumn"; break;}
A. winter
B. spring
C. summer
D. autumn
查看答案
下列代码段执行后, f的值为()int x = 12, f;f = 1;for (int i = 2; i < x; i++) if (x % i == 0) f = f + i;
A. 12
B. 16
C. 15
D. 66
下列代码段执行后, n的值为()int n = 0;for (int i = 1; i <= 3; i++) for (int j = 1; j <= 2 * i - 1; j++) n++;
A. 3
B. 6
C. 9
D. 15
下列代码段执行后的结果是()int[] a = { 1, 3, 5, 2, 4 };int j = 4;for (int i = 0; i < 5; i++) { a[i] = a[j]; j--;}for (int i = 0; i < 5; i++) System.out.print(a[i] + " ");
A. 1 2 3 4 5
B. 5 4 3 2 1
C. 4 2 5 2 4
D. 4 2 5 3 1
类Car中的toString()直接继承于类Object, 执行下面程序段Car testcar = new Car();System.out.print(testcar.toString());后打印testcar.Car@1270b73, 其中的数值是()
A. 对象的值
B. 对象的hash值
C. 对象的地址
D. 随机的