static{ 
    System.out.println("father static"); 
  } 不知道这个东西是拿来干什么的

解决方案 »

  1.   

    father static
    child static
    father cls
    child cls
    顺序 父静态 子静态 父实例变量 父类构造方法 子类实例变量 子类构造方法
      

  2.   

    father static
    child static
    father cls
    child cls
    顺序 父静态 子静态 父实例变量 父类构造方法 子类实例变量 子类构造方法正解
      

  3.   

    static{block;}
    这个东西在你的类载入的时候会执行
      

  4.   

    public static void main (String args[]){
      try{
      Class.forName("Test");//载入类
      System.out.println("this");
      }catch (Exception e) {

    }
      new Test();
      }
    如果你这样用,那么输出结果是:
    father static//
    child static//这两个载入的时候输出。
    this//自己写的输入语句。
    father cls
    child cls//这两个实例化的时候输出
      

  5.   

    先父类的静态块,然后在子类的静态块
    在后是父类的构造函数,最后是子类的构造函数!father static
    child static
    father cls
    child cls
      

  6.   

    father static
    child static
    father cls
    child cls