知识点:Java 9/10(单选)
What is the output of the following program?
class A {
static { System.out.print("A"); }
}
class B {
static { System.out.print("B"); }
}
class C {
static { System.out.print("C"); }
}
class D {
static { System.out.print("D"); }
}
public class InitOrder {
B b = new B();
static A a = new A();
public static void main(String[] args) {
try {
int a = 1;
if (a > 0) {
new D();
throw new RuntimeException("");
} else {
new C();
}
} finally {
new B();
}
}
}