class Bar { }
class Test
{
Bar doBar()
{
Bar b = new Bar(); /* Line 6 */
return b; /* Line 7 */
}
public static void main (String args[])
{
Test t = new Test(); /* Line*/
Bar newBar = t.doBar(); /* Line*/
System.out.println("newBar");
newBar = new Bar(); /* Line*/
System.out.println("finishing"); /* Line*/
}
}
At what point is the Bar object, created on lineeligible for garbage collection? |