question about java garbage collector

guest (Yue)
Consider the following code:
Public void method(String s)
{
String a,b;
a= new String( "Hello");
b= new String("Goodbye");
System.out.println(a+b);
a= null;
a=b;
System.out.println(a+b);
}

Where the garbage collector will run the first time?
In line "a=null" or " a=b"?
I think it will run in "a = null" at first, then "a=b".
(#94412@0)
2001-6-8 -05:00

回到话题: question about java garbage collector

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论

URL:   
http://www.rolia.net/zh/post.php?f=0&p=94412