????????Sub.B?ж?????????????????Sub??????г????????????丸??Parent?????г??????????Parent???????A=2??????B=2??????????????

    static class Parent{ 
        <clinit>(){ 
            public static int A=1; 
            static{ 
                A=2; 
            } 
        } 
    } 
    static class Sub extends Parent{ 
        <clinit>(){  //jvm??????????÷????????????????? 
        public static int B=A; 
        } 
    } 
    public static void main(String[] args){ 
        System.out.println(Sub.B); 
    }

????<clinit>();???????????????????????????????????????ж?????????и??????о??????飬<clinit>()?????????????????ɡ?

?????????????治?????static{}??????????飬????????????????????????????????????????????????????<clinit>()??????????????????????????????<clinit>();??????????????и?????<clinit>();??????????????ж?????????????????????????????

??????????????????????????????????????н???<clinit>()????????

????????jvm?????????<clinit>();???????????????????????????????<?????????????????>??

????????????????????£?

    public class DeadLoopClass { 
    
        static{ 
            if(true){ 
            System.out.println("??? ["+Thread.currentThread()+"] ????????????????????????"); 
            while(treu){}    
            } 
        } 
         
        /** 
         * @param args 
         */
        public static void main(String[] args) { 
            // TODO Auto-generated method stub 
            System.out.println("toplaile"); 
            Runnable run=new Runnable(){ 
    
                @Override
                public void run() { 
                    // TODO Auto-generated method stub 
                    System.out.println("["+Thread.currentThread()+"] ??????????????"); 
                    DeadLoopClass d=new DeadLoopClass(); 
                    System.out.println("["+Thread.currentThread()+"] ???????????????????"); 
                     
                }}; 
                 
                new Thread(run).start(); 
                new Thread(run).start(); 
        } 
    
    }

?????????棬???е????????????????