日期:2014-05-20 浏览次数:20741 次
class A { static { System.out.println("A static block"); } { System.out.print("Q"); } public A() { System.out.println("x"); } } class B extends A { static { System.out.println("B static block"); } { System.out.print("W"); } public B() { System.out.println("y"); } } public class Test { static { System.out.println("begin"); } { System.out.println("executing"); } public static void main(String...args) { A ab = new B(); ab = new B(); new B(); new A(); } }