//this指向子类,因为创建子类对象,子类调用父类,执行时看右边即子类
public class Test {
public static void main(String[] args) {
Son son = new Son();
son.eat();
}
}
class Father{
{//this指向子类,因为创建子类对象,子类调用父类,执行时看右边即子类
System.out.println(this);
}
public void eat() {
System.out.println("father eat");
}
}
class Son extends Father{}