336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

package Runtime;

public class addShutdownHook {
    public static void main(String[] args)throws Exception{
        Object f=new Object(){
            public void finalize() {
                System.out.println("Running finalize");
            }
        };
        Runtime.getRuntime().addShutdownHook(new Thread(){
            public void run(){
                System.out.println("Running Shutdown Hook");
            }
        });

        f=null;
        System.gc();
       
        System.out.println("Calling System.exit()");
        System.exit(0);
    }
}

'Java' 카테고리의 다른 글

Runtime : exec(String command)  (0) 2015.01.28
Runtime : exec(String[] command)  (0) 2015.01.28
Runtime : availableProcessors()  (0) 2015.01.28
URL : openStream()  (0) 2015.01.25
URL : openConnection()  (0) 2015.01.25
Posted by af334