为了账号安全,请及时绑定邮箱和手机立即绑定

输出的数字总是hashcode

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]);

}

http://img1.sycdn.imooc.com//57f399820001642004710172.jpg

正在回答

2 回答

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);

}


0 回复 有任何疑惑可以回复我~
#1

宁敏 提问者

非常感谢!
2016-10-04 回复 有任何疑惑可以回复我~

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);

}


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

输出的数字总是hashcode

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信