宁敏
2016-10-04 19:59
Car car1[] = { new Car(1, "奥迪A6", "500/天", "载人"),
new Car(2, "马自达6", "300/天", "载人"),
new Car(3, "金龙皮卡", "600/天", "载货"),
new Car(4, "雪铁龙251", "400/天", "载人,载货"),
new Car(5, "长城C30", "200/天", "载人") };
System.out.println("您可租车的类型及价格目录表:");
System.out.println("序号" + "\t" + "汽车名称" + "\t" + "租金(元/天)" + "\t" + "容量");
for(int i =0 ;i<car1.length;i++){
System.out.println(" " + (i+1) + "\t" + car1[i]);
}
for (int i = 0; i < car1.length; i++) {
System.out.println(" " + (i + 1) + "\t" + car1[i].carName + "\t"+ car1[i].theRent + "\t" + car1[i].capacity);
}
for (int i = 0; i < car1.length; i++) {
System.out.println(" " + car1[i].carNum + "\t" + car1[i].carName + "\t"+ car1[i].theRent + "\t" + car1[i].capacity);
}
Java入门第二季 升级版
530653 学习 · 6091 问题
相似问题