Object: finalize()
public class MainClass { public static void main(String[] args) throws Exception { Object f = new Object() { public void finalize() { System.out.println("Running finalize()"); } }; Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { System.out.println("Running Shutdown Hook"); } }); f = null; System.gc(); System.out.println("Calling System.exit()"); System.exit(0); } }
1. | Object: getClass() | ||
2. | Object: getClass() (2) | ||
3. | Object: hashCode() | ||
4. | Object: notifyAll() | ||
5. | Object: toString() | ||
6. | Object: wait(long timeout) |