62,634
社区成员




public class Test {
private int k = printInit("Beetle.k initialized");
int j;
public Test() {
System.out.println("k = " + k);
System.out.println("j = " + j);
}
private static int x2 = printInit("static Beetle.x2 initialized");
static int printInit(String s) {
System.out.println(s);
return 47;
}
public static void main(String[] args) {
System.out.println("Beetle constructor");
new Test();
}
}
public class Test {
static {
RuntimeException ex = new RuntimeException();
ex.fillInStackTrace();
ex.printStackTrace();
}
public Test() {
throw new RuntimeException();
}
public static void main(String[] args) throws Exception {
new Test();
}
}