问题:this 是什么?
案例说明:
1>父类
2>子类
3>测试
结果:
1 parent init
4 son demo
3 son init
分析:
父类中this是指编译中new出来的对象, 在运行时使用该对象,也就是son对象,所以在子类调用父类的init()方法时,中的this是指测试类中new出来的对象,而不是父类对象。