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");
a= null;

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".
2001-6-8 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: question about java garbage collector

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论