单项选择题
12. void start() {
13. A a = new A();
14. B b = new B();
15. a.s(b);
16. b = null;
17. a = null;
18. System.out.println(“start completed”);
19. }
When is the B object, created in line 14, eligible for garbage collection?()
A. After line 16.
B. After line 17.
C. After line 18 (when the methods ends).
D. There is no way to be absolutely certain.
E. The object is NOT eligible for garbage collection.
相关考题
-
单项选择题
for (int i =0; i < 4; i +=2) { System.out.print(i + “”); } System.out.println(i); What is the result?()
A. 0 2 4
B. 0 2 4 5
C. 0 1 2 3 4
D. Compilation fails.
E. An exception is thrown at runtime. -
单项选择题
float f[][][] = new float[3][][]; float f0 = 1.0f; float[][] farray = new float[1][1]; What is valid?()
A. f[0] = f0;
B. f[0] = farray;
C. f[0] = farray[0];
D. f[0] = farray[0][0]; -
单项选择题
int x = 1, y =6; while (y--) { x++; } System.out.println(“x =” + x + “y =” +y); What is the result?()
A. x = 6 y = 0
B. x = 7 y = 0
C. x = 6 y = -1
D. x = 7 y = -1
E. Compilation fails.
