哪位老铁给解释下为什么子类Son里的this.name();调用的是父类的方法,this不是调用当前类的方法吗?
public class Father { public double a=1; private double b; public static int i=2; public double Gettera() { return a; } public void Settera(double a1) { // TODO Auto-generated method stub a=a1; } public void name() { System.out.println("我叫小白"); } } public class Son extends Father { public void sonName() { System.out.println("我叫小黑"); this.name(); super.name(); } } public class Initail { public static void main(String[] args) { // TODO Auto-generated method stub new Son().sonName(); } }