wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "How many eligible for GC?" Watch "How many eligible for GC?" New topic

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: 14074

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 7 API documentation
Scala Notes - My blog about Scala
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?
Similar Threads
Problem in Garbage collector
Garbage Collection Question from Devaka's Exam Labs for SCJP6 - diagnostic exam question number 70.
Garbage collect question
Objects eligible for GC
Garbage Collection Question