File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How many eligible for GC?

 
Anuradha Prasanna
Ranch Hand
Posts: 115
  • 0
  • 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
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
 
Anuradha Prasanna
Ranch Hand
Posts: 115
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, i got it!
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic