摘要: 什么是向上转型? 通过在网上查了资料,和普遍的介绍,一句话总结就是“父类引用指向子类对象”,例: Human h=new Human(); h.eat();//人类 Animal a=new Animal(); a.eat();//动物 //父类-Human,子类-Animal,a-父类引用,new 阅读全文
posted @ 2023-10-15 21:53 szmtjs10 阅读(108) 评论(0) 推荐(0) 编辑