package imooc2_6_1;public class Car { int NO; String name; String type; int zaike; int zaihuo; double money;}
package imooc2_6_1;public class Car_1 extends Car { { super.NO=1; super.name="霸龙重卡"; super.type="大型货车"; super.zaihuo=20; super.money=800; } public String toString() { return NO +". "+ name +": "+ type + "——载货量:" + zaihuo + "T" + " " + money + "元/天"; }}
package imooc2_6_1;public class Car_2 extends Car { { super.NO=2; super.name="五菱宏光小卡车"; super.type="小型货车"; super.zaihuo=5; super.money=500; } public String toString() { return NO +". "+ name +": "+ type + "——载货量:" + zaihuo + "T" + " " + money + "元/天"; }}
package imooc2_6_1;public class Car_3 extends Car { { super.NO=3; super.name="奔驰"; super.type="小汽车"; super.zaike=4; super.money=700; } public String toString() { return NO +". "+ name +": "+ type + "——载客量:" + zaike + "人" + " " + money + "元/天"; }}
package imooc2_6_1;public class Car_4 extends Car { { super.NO=4; super.name="加长林肯"; super.type="大型轿车"; super.zaike=17; super.money=1000; } public String toString() { return NO +". "+ name +": "+ type + "——载客量:" + zaike + "人" + " " + money + "元/天"; }}
package imooc2_6_1;public class Car_5 extends Car { { super.NO=5; super.name="这是一个皮卡车"; super.type="皮卡"; super.zaihuo=2; super.zaike=4; super.money=600; } public String toString() { return NO +". "+ name +": "+ type + "——载客量:" + zaike + "人" + " 载货量:" + zaihuo + "T" + " " + money + "元/天"; }}