This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Mock question for Garbage Collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Mock question for Garbage Collection" Watch "Mock question for Garbage Collection" New topic
Author

Mock question for Garbage Collection

Sam Sunamin
Ranch Hand

Joined: Mar 16, 2007
Posts: 113
From Whizlabs,



My answer for it is C since s refer to other object(Hello World) not the object created on line 1, so the object is eligible to collection.

Am I right? Please help me to confirm.

Thank you.


Yours Sam<br />SCJP5.0 97%<br />SCBCD5.0 72%
megha joshi
Ranch Hand

Joined: Feb 20, 2007
Posts: 206
Yes you are right . C is the correct answer.

One more thing...K&B book states garbage collection with strings is not included in exam.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mock question for Garbage Collection