Java多态性,从内存的角度分析

  this:  最终子类的地址this super:每一层的父类code 因此无论每一层的this都是指向最下层子类,若是找不到方法就去上找,直到找到方法blog public class Test {   public static void main(String[] args) { Animal a = new Dog();   a.shout();
相关文章
相关标签/搜索