class Father {        public Father()
        {
                System.out.println("Father's Constructor!");
                f();
        }
        void f()
        {
                System.out.println("Father's function!");
        }
}
public class Son extends Father
{        public Son()
        {
                System.out.println("Son's Constructor!");
                f();
        }
        void f()
        {
                System.out.println("Son's function!");
        }
        public static void main(String[] args)
        {
                Son son = new Son();
        }
}
就上面的一段程序,输出的结果是:
Father's Constructor!
Son's function!
Son's Constructor!
Son's function!
这里,小弟不大明白:
本来子类的构造函数将构造函数的参数(这里无参),那么打印第一句Father's Constructor!没有问题,只是为什么接下来是打印Son's function!而不是Father's function!呢?