对象数组!!!!!!!!!!!!!
我想知道你们的父类子类是怎么写的 我总感觉自己写的不太对 main方法中用不了对象数组 会显示错误 求完整的父类子类 代码 !谢谢大佬
我想知道你们的父类子类是怎么写的 我总感觉自己写的不太对 main方法中用不了对象数组 会显示错误 求完整的父类子类 代码 !谢谢大佬
2018-09-27
package BorrowMain;import BorrowClass.Bus;import BorrowClass.Car;import BorrowClass.Train;import BorrowClass.kaCar;public class borrow {Train[] motos=new Train[11];public void init(){ motos[0]=new Car("京NY28588","宝马",800,"X6"); motos[1]=new Bus("京6566754","金杯",800,16); motos[2]=new Car("京CNY3284","宝马",600,"550i"); motos[3]=new Bus("京8696997","金龙",800,16); motos[4]=new Car("京NT37465","别克",300,"林荫大道"); motos[5]=new Bus("京6566754","金杯",1500,34); motos[6]=new Car("京NT96968","别克",600,"GL8"); motos[7]=new Bus("京8696998","金龙",1500,34); motos[8]=new kaCar("赣A06E37","killerqueen",0,15); motos[9]=new kaCar("赣A77777","公路杀手",0,20); motos[10]=new kaCar("赣GA4396","水泥明星",0,20);}}
举报