Pfeffer
Pfeffer
2018-01-02 05:52

为什么这个程序会出现StackFlowException 呢

10
  • java
  • 对象
 public class CodeBlockDemo {

    static CodeBlockDemo cbd;
    CodeBlockDemo scb = new CodeBlockDemo();
    static {
        cbd = new CodeBlockDemo();
        int a = 1;
        System.out.println("hot");
        System.out.println(a);
    }

    CodeBlockDemo(){
        System.out.println("构造器");
    }
    public static void main(String[] args) {
        int[] a = new int[] {1,2,3,4};
        Object b =a;
        Object m = new int[] {2,3,4};
        Object[] element = new Integer[] {2,3,4};
        Object[] arr = {};

    }

}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

8条回答