Questions on GC from Khalid A.Mughal, Chap 9

On page 402 & 403 of this book, there are no answers for four GC questions.

1)How many objects are eligible for GC when control reaches (1)?

I think, 9 objects are eligible for GC. is that right?
but the answers are,
(A)0
(B)5
(c)10

can anyone tell the right answer with explanation?
--------------------------------------------------------------------------------------------------------------------------------------
2)How many objects are eligible for GC when control reaches (1)?

You're posting in the wrong forum. This looks like a question for the SCJP forum.

BTW, I didn't look at the rest but your answer for #1 is wrong. Take a look at the code, a new instance of Eligible gets created each time through the loop but no reference is kept. So the correct answer is the number of times the loop executes - which isn't nine.

Good luck with your studies. I recommend Kathy Sierra and Bert Bate's SCJP Study Guide - but I'm partial as I was one of the technical reviewers. Still I've used it as the textbook for an SCJP study group and everybody seemed to like the book and the folks who took the exam passed so I guess there's objective proof that it's a good book. Of course it doesn't hurt that KAthy and Bert helped write the exam...