老师求解啊
Car[] car={new Truck("黄海",400,40),new Truck("松花江",200,20),new Coach("马自达",300,5),new Coach("奔驰",500,4),new Pickup("福特",600,5,20)}; 老师这个定义我没懂,为什么父类引用指向子类对象还可以变成数组啊
Car[] car={new Truck("黄海",400,40),new Truck("松花江",200,20),new Coach("马自达",300,5),new Coach("奔驰",500,4),new Pickup("福特",600,5,20)}; 老师这个定义我没懂,为什么父类引用指向子类对象还可以变成数组啊
2015-06-09
举报