📜  java 关闭挂钩 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:37.283000             🧑  作者: Mango

代码示例1
Thread printingHook = new Thread(() -> System.out.println("In the middle of a shutdown"));
Runtime.getRuntime().addShutdownHook(printingHook);