home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-05-08 | 345 b | 17 lines |
- class Clean {
- public static void main(String[] args) {
- Dirty d = new Dirty();
- d.finalize();
- d = null;
- Runtime r = Runtime.getRuntime();
- r.gc();
- r.runFinalization();
- }
- }
-
- class Dirty {
- protected void finalize() throws Throwable {
- System.out.println("Dirty finalization");
- }
- }
-