Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How many eligible for GC?

 
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
Saloon Keeper
Posts: 15214
36
Android IntelliJ IDE Java Scala Spring
 
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