I too made a memory map diagram for the same and I conclude that because of a2.a=null and a1=a3 just one object that is a2 is eligible for garbage collection because as a1 and a3 are still being referenced so they are not eligible . am I understanding it correctly?
Can you please tell more specifically which object is eligible for garbage collection and why because by diagram I am able to understand that one object is there which is eligible for it but which one . I guessed is a2. Please clear it.