1.

class X2 _x000D_ {_x000D_ public X2 x;_x000D_ public static void main(String [] args) _x000D_ {_x000D_ X2 x2 = new X2(); /* Line 6 */_x000D_ X2 x3 = new X2(); /* Line 7 */_x000D_ x2.x = x3;_x000D_ x3.x = x2;_x000D_ x2 = new X2();_x000D_ x3 = x2; /* Line 11 */_x000D_ doComplexStuff();_x000D_ }_x000D_ }_x000D_ _x000D_ after line 11 runs, how many objects are eligible for garbage collection?

A. 0
B. 1
C. 2
D. 3
Answer» D. 3


Discussion

No Comment Found

Related MCQs