following is the code snippet from Cathy Siera SCJP book.
When // doStuff is reached, how many objects are eligible for GC?
D. Compilation fails
E. It is not possible to know
F. An exception is thrown at runtime.
The answer for above code is C. Author says only two objects are eligible. Object c1 and Story object associated with it.
Can anyone please explain why answer is 2. Why only 2 objects are eligible for garbage collection and why Cardboard c3 is not eligible for garbage collection?