1.

public class X { public static void main(String [] args) { X x = new X(); X x2 = m1(x); /* Line 6 */ X x4 = new X(); x2 = x4; /* Line 8 */ doComplexStuff(); } static X m1(X mx) { mx = new X(); return mx; }
}
After line 8 runs. how many objects are eligible for garbage collection?

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


Discussion

No Comment Found

Related MCQs