Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When the a, and b are eligible for GC?

 
bujin wang
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Adrian Pang
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SCJP is properly a better forum for this post, but the variable is available for GC as soon as there are no more reference to it. The a inside testB is gone with the instance of testB is gone; which is the case when the instance of TestA is gone; which is the case when testAll completes. After testAll, a and b are candidates for GC.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic