6-1帮我看看应该咋改
for( k=0;k<total;k++){
System.out.println("请输入第"+""+(k+1)+"辆车的序号");
chooseNums[k]=a.nextInt();
}
System.out.println("请输入租车天数");
int days =a.nextInt();
int totalMoney=0;
System.out.println("您的账单:");
System.out.println("***可载人的车有:");
int money1=0;
int money2=0;
int money3=0;
int money=0;
int j;
for(j=0;j<total;j++){
if(messenge[chooseNums[k]] instanceof Car){
System.out.println(messenge[chooseNums[k]].name);
money1+=messenge[chooseNums[k]].rent;
}else if(messenge[chooseNums[k]] instanceof PickUp){
System.out.println(messenge[chooseNums[k]].name);
money2+=messenge[chooseNums[k]].rent;
}
提示数组过界