The class Test is:
public class Test {
private final Object finalizerGuardian = new Object() {
@Override
protected void finalize() throws Throwable {
System.out.println("finalize");
super.finalize();
}
};
public static void main(String args[]) {
Test s = new Test("s");
s = null;
}
}
the finalize method api doc is:
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
but when the main method execute competely I can not see the output "finalize" So,how to see the output