Dennis Thomas wrote:Thanks Rahul
The code sample comes from Chapter 3 Self-test, question #11. The Answer explained that three objects are still referred by reference variables a2, a2.b1 and a2b2. So only one object that was belonging to a1 would be eligible for garbage collection.Dennis Thomas wrote:How many Objects would be eligible for garbage collection when it reaches line 16 and which one and how?