Java > Other sample source codes
Shut down hooks
Shut down hooks package com.ack.j2se.lang; public class ShutdownHooks { public static void main( String[] args ) { Thread myShutdownThread = new Thread( new ShutdownProcess() ); Runtime.getRuntime().addShutdownHook( myShutdownThread ); } } class ShutdownProcess implements Runnable { public void run() { System.out.println( "System shutdown at: " + new java.util.Date( System.currentTimeMillis() ) ); } }
Java Codes
Beginners
Core Java
Date Time
Java2D
Java Applets
Java AWT
Mathematics
Networking
Servlets
Session
Sound
Swing
Threads
Util Package
JDBC
Learning
Other
Security
XML