摘要: 多态:调用一个方法(c语言叫函数)时,不是看引用的类型,而是看对象的实际类型 例如: 隐式转换(子类转化为父类) ApplePie a1 = new ApplePie(); //前提是ApplePie继承了Pie这个父类 class ApplePie extends Pie Pie a2 = a1; 阅读全文
posted @ 2020-06-22 17:20 艺术天分高 阅读(144) 评论(0) 推荐(0)