• Post Reply Bookmark Topic Watch Topic
  • New Topic

Garbage collection program really confusing me?  RSS feed

 
Vishal Hegde
Ranch Hand
Posts: 1078
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



How come 1 object is eligible for garbage collection?
}
}
 
Vijitha Kumara
Bartender
Posts: 4002
42
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a mock question? Then please QuoteYourSources
 
Vishal Hegde
Ranch Hand
Posts: 1078
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya from scjp 6 book kathy sierras but i cudnt understand how come only one object becomes eligible for garbagre collection
 
Vijitha Kumara
Bartender
Posts: 4002
42
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vishal,

Best way to see is by drawing the objects in the question with their relationships. And a simple search will give you same exact question discussed before in the forum like this
Make a special note about the static reference too.


 
Vishal Hegde
Ranch Hand
Posts: 1078
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok Vijitha thanks in advance, can you give me a diagramatic representation on how to represent a garbage collection .I saw in the book related to isolations of island i was unable to understand the diagram (i did understood the diagram a bit but not in a crystal clear manner .)
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Draw object "A" then an arrow to object "B", etc etc.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!