aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes How many eligible for GC? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "How many eligible for GC?" Watch "How many eligible for GC?" New topic
Author

How many eligible for GC?

Anuradha Prasanna
Ranch Hand

Joined: Mar 09, 2006
Posts: 115
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?


SCJP 6.0 90%
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14430
    
  23

This question has been discussed before:

One object eligible for garbage collection?
Garbage Collection

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Anuradha Prasanna
Ranch Hand

Joined: Mar 09, 2006
Posts: 115
Thanks, i got it!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How many eligible for GC?