1.

class HappyGarbage01 { public static void main(String args[]) { HappyGarbage01 h = new HappyGarbage01(); h.methodA(); /* Line 6 */ } Object methodA() { Object obj1 = new Object(); Object [] obj2 = new Object[1]; obj2[0] = obj1; obj1 = null; return obj2[0]; } }
Where will be the most chance of the garbage collector being invoked?

A. After line 9
B. After line 10
C. After line 11
D. Garbage collector never invoked in
E. <i class="java-code">methodA()</i>
Answer» E. <i class="java-code">methodA()</i>


Discussion

No Comment Found

Related MCQs