英文:
the method holdtrack.enqueue(smallestParcel); is Int cannot be dereferenced
问题
public static boolean sequence(){
int holdtrack=0;
for(int i=0;i<9;i++)
while(holdtrack<3){
if(!track[holdtrack].isEmpty()){
if(track[holdtrack].front().equals(smallestParcel)){
holdtrack.enqueue(smallestParcel);
System.out.println("Move parcel " + smallestParcel
+ " from holding buffer track H" + (holdtrack + 1) + " to output buffer");
smallestParcel++;
break;
}
}
holdtrack++;
}
return true;
}
英文:
public static boolean sequence(){
int holdtrack=0;
for(int i=0;i<9;i++)
while(holdtrack<3){
if(!track[holdtrack].isEmpty()){
if(track[holdtrack].front().equals(smallestParcel)){
holdtrack.enqueue(smallestParcel);
System.out.println("Move parcel " + smallestParcel
+ " from holding buffer track H" + (holdtrack + 1) + " to output buffer");
smallestParcel++;
break;
}
}
holdtrack++;
}
return true;
}
专注分享java语言的经验与见解,让所有开发者获益!
评论