以下代码运行的结果是什么
public class TestGC {
private static TestGC TEST_GC = null;
private void isAlive() {
System.out.print("Yes,I'm Alive!" + "、");
}
@Override
protected void finalize() throws Throwable {
super.finalize();
System.out.print("finalize mehtod executed!" + "、");
TestGC.TEST_GC = this;
}
public static void main(String[] args) throws Throwable {
TEST_GC = new TestGC();
TEST_GC = null;
System.gc();
Thread.sleep(500);
if (TEST_GC != null) {
TEST_GC.isAlive();
} else {
System.out.print("NO,I'm dead!" + "、");
}
TEST_GC = null;
System.gc();
Thread.sleep(500);
if (TEST_GC != null) {
TEST_GC.isAlive();
} else {
System.out.print("NO,I'm dead!");
}
}
}