Esther Kak wrote:But then how do you join objects(Boxes) with arrows and delete them?
I delete arrows using the backspace key (I hope the joke's funny)
Anyways, when a reference variable starts pointing to another object or to null, then the reference stops pointing to the new object and thus the arrow between the earlier object and the reference is gone.
Lets take an example
At line 1, the reference p is pointing to the first Person object.
But at the next statement, p starts pointing to a different object, so the first one is eligible for GC
I hope this clears your doubt...