JAVA addShutdownHook测试

public static void main(String[] args) {
        System.out.println("1111111111");
        try {
            Thread.sleep(5000);
        } catch (Exception e) {
            // TODO: handle exception
        }
        Runtime.getRuntime().addShutdownHook(new Thread(){
            @Override
            public void run() {
                Thread.currentThread().setName("main");
                System.out.println("0000000000000000");

            }
        });
        
        System.out.println("2222222222");
    }