This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I agree with Abimaran. You can solve these types of questions easily if you draw a diagram of what is happening. I draw usually the given objects in circles and then I draw a arrow pointing to that circle. The arrows thus begins with the reference variable name and ends with the circle which represents the object. Then I delete and move the arrows as the code follows and at the desired line, I count the circles to which there are no arrows pointing to. This is the number of objects eligible for GC. I hope I wrote it understandably :-)