wood burning stoves 2.0*
The moose likes Certification Results and the fly likes 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 » Certification Results
Bookmark "Garbage collection" Watch "Garbage collection" New topic
Author

Garbage collection

george tharakan
Greenhorn

Joined: Jan 12, 2001
Posts: 7
what is the earliest line in the following code after which object b
will be a candidate for being garbage collected.
public class test{
Static string f()
{
String s="hello";
String b="bye"; //1
String c=b+"i";
String d=b;
b=a; //2
d=a; //3
return c; //4
}
public static void main(String s[])
{String msg=f();
System.out.println(msg); // 5
}
}
can any one tell the answer with explanation
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi George,
Moving this to the Certification Study group as it's not related to results.

------------------

Jane Griscti
Sun Certified Java 2 Programmer
"When ideas fail, words come in very handy" -- Goethe


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
 
 
subject: Garbage collection