@@ -0,0 +1,288 @@
+class ShutdownHook %7B%0A    static public void main(String%5B%5D args) throws Exception %7B%0A        Runtime.getRuntime().addShutdownHook(new Thread() %7B%0A            public void run() %7B%0A                System.out.println(%22shutdown%22);%0A            %7D%0A        %7D);%0A        throw new Exception();%0A    %7D%0A%7D%0A

Use shutdown hook to ensure execute statements at the end.