¿¹Á¦

protected void finalize() throws Throwable {
System.out.println("Not calling super.finalize()"); //$NON-NLS-1$
}

public static void main(String[] args) {
SuperFinalize_Example sf = new SuperFinalize_Example();
sf = null;
Runtime.getRuntime().gc();
}

¼Ö·ç¼Ç
super.finalize()¿¡ ´ëÇÑ È£ÃâÀ» finalize() ¸Þ¼ÒµåÀÇ ÃÖÁ¾ ¸í·É¹®À¸·Î »ðÀÔÇϽʽÿÀ.

protected void finalize() throws Throwable {
try {
System.out.println("Calling super.finalize()"); //$NON-NLS-1$
} finally {
super .finalize();
}
}

public static void main(String[] args) {
SuperFinalize_Example sf = new SuperFinalize_Example();
sf = null;
Runtime.getRuntime().gc();
}