• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Garbage Collection (Islands of isolation)

 
Juan Manuel Alberto de los Santos
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Vijitha Kumara
Bartender
Posts: 3914
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i1 object's i instance variable referes to i2 object and i2's instance variable refers to i1 object. When you make i1 & i2 null those two objects become isolated from outside.
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even though both objects still have a reference (from the other one), no other code can ever get a reference.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic