Példa

protected void finalize() throws Throwable {
System.out.println("Nem hívja meg a super.finalize() metódust"); //$NON-NLS-1$
}

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

Megoldás
Szúrja be a super.finalize() meghívását utolsó utasításként a finalize() metódusba.

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

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