I think that all local variables become eligible for garbage collection when the block is finished.After which line will the object created at line XXX be eligible for garbage collection?
public Object getObject(Object a) //0
{ Object b = new Object(); //XXX
Object c, d = new Object(); //1
c = b; //2
b = a = null; //3
return c; //4
}
A method is over after a return statement. So in line 4 method (just after) getObject is finished and all local variables become eligible for garbage collection.
Where am i wrong?