public class test { public static void main(String args[]) { char c; int i; c = 'A'; // 1 i = c; //2 c = i + 1; //3 c++; //4 } }
(A) 标记为1的行。
(B) 标记为2的行。
(C) 标记为3的行。
(D) 所有行都是正确的
9. 编译并运行以下代码时会发生什么。 选择一个正确的答案。
for(int i = 1; i < 3; i++) for(int j = 3; j > i; j--) assert i!=j {System.out.println(i); }
(A) 该类编译并运行,但不打印任何内容。
(B) 数字1由AssertionError打印
(C) 该程序生成编译错误。
(D) 数字2由AssertionError打印
10. 其中哪些是合法标识符 a. number_1 b. number_a c. $1234 d. -volatile
(A) a, b, c
(B) a, b
(C) a
(D) b
11. 以下哪些关于Java语言的陈述是正确的?
(A) Java支持过程和OOP。
(B) Java仅支持编程的过程方法。
(C) Java仅支持OOP方法。
(D) 以上都不是。
12. Which of the following is a Java keyword.Select the four correct answers. a. extern b. synchronized c. volatile d. friend e. friendly f. transient g. this h. then
(A) b, c
(B) b, c, f, g
(C) e, g, h
(D) 以上所有。
13. 编译并运行以下程序时,屏幕上显示的内容。 选择一个正确的答案。
protected class example { public static void main(String args[]) { String test = "abc"; test = test + test; System.out.println(test); } }