Here is my impression of which objects are created and how the references relate to them:
When line 16 is reached, how many objects will be eligible for garbage collection?
A. 0
B. 1
C. 2
D. 3
E. 4
F. 5
I selected
D
The answer says that "B is correct. It should be clear that there is still a reference to the object referred to by a2, and that there is still a reference to the object referred to by a2.b2. What might be less clear is that you can still access the other Beta object through the static variable a2.b1 - because it's static" (K & B, 2000-something, p. 285).
What am I missing here? 0_o
*** Also which b1 and b2 are set to null? The class variable of Alpha and its instance variables or the variables declared in main and their instances?