Garbage Collection
© examsiri.com
Question : 1 of 7
Marks:
+1,
-0
Given:
When the doSomething method is called, after which line does the Object created in line 5 become available for garbage collection?
1. public class GC {
2.   private Object o;
3.   private void doSomethingElse(Object obj) { o = obj; }
4.   public void doSomething() {
5.    Object o = new Object();
6.    doSomethingElse(o);
7.    o = new Object();
8.    doSomethingElse(null);
9.    o = null;
10.   }
11. }When the doSomething method is called, after which line does the Object created in line 5 become available for garbage collection?
Go to Question: