Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How many eligible for GC?  RSS feed

 
Anuradha Prasanna
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a question from ExamLab. How many objects are eligible for GC?



Answer is 2.

But i think, only 1 is eligible for GC ie. the object refered to by c before it is nulled.
Is there any object eligible for GC in line-1?
can anyone explain how come 2 objects are eligible for GC here?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16006
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question has been discussed before:

One object eligible for garbage collection?
Garbage Collection
 
Anuradha Prasanna
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, i got it!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!