SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
Originally posted by Marcus Green:
I have had the following option on one of my exams for a while and I'd like to get a wider opinion on it. Is the following statement true or false?
An object becomes eligible for garbage collection when all references to it are set to null.
Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
SCJP 1.4--93%<br />SCWCD 1.4--86%<br />Next--???
SCJP 1.4--93%<br />SCWCD 1.4--86%<br />Next--???
Originally posted by karthikeyan balasubramanian:
Actually the question is trying to test the knowledge of Isolation of References.
The key point is if we set the real reference variable pointing to the object null,although we have instance variables of that class pointing to that object not set to null...The object is automatically eligible for garbage collection.
i think i m right.
SCJD<br />SCJP 1.4
Setting the last reference to null is not the only way to make the object eligible for gc.
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Regards<br />Lakshmanan<br />IBM-OOAD & UML, SCEA-I
SCJD<br />SCJP 1.4
Vincent Brabant<br /><a href="http://fr.netbeans.org" target="_blank" rel="nofollow">http://fr.netbeans.org</a>
I would like to say false,
because you can have Weak References to that object.
An object becomes eligible for garbage collection when all references to it are set to null.
An object becomes eligible for garbage collection when all references to it are null.
The knights of nee want a shrubbery. And a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|