package com.heavan.test;
public class ConstractionTest {
/**
* 输出结果为:?
*/
public static void main(String[] args) {
new A();
}
}
class A {
{
System.out.print("A");
}
static {
new B(1);
}
static B b1 = new B();
A() {//
this(1);
System.out.print("B");
}
A(int i) {//
System.out.print("C");
}
}
class B {
static {
System.out.print("D");//
}
B() {
this(1);//
System.out.print("E");
}
B(int i) {
System.out.print("F");
new A();//
}
}
转载于:https://my.oschina.net/u/590649/blog/115937