Hi there,
can anyone explain to me the following:
Given:
When line 20 is reached, how many objects will be eligble for garbage collection?
The correct answer is 1 and the explanation is:
It should be clear that there is still a reference to the object referred to by a2 ( I understand that), and that there is still a reference to the object referred to by a2.b2 ( I understand that).
What might be less clear is that you can still access the other Beta object trough the static variable a2.b1 becausae it s static ( I dont understand this).
Which object is elegible for GC?
Regards
Max