Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
System.out.println("当前getRuntime函数调用后,出现异常退出时触发执行");
}
});
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
System.out.println("当前getRuntime函数调用后,出现异常退出时触发执行");
}
});