holdtrack.enqueue(smallestParcel); 的方法是 Int 无法被解引用。

huangapple 未分类评论43阅读模式
英文:

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&lt;9;i++)
        while(holdtrack&lt;3){
            if(!track[holdtrack].isEmpty()){
                if(track[holdtrack].front().equals(smallestParcel)){
                    holdtrack.enqueue(smallestParcel);
                    System.out.println(&quot;Move parcel &quot; + smallestParcel
                        + &quot; from holding buffer track H&quot; + (holdtrack + 1) + &quot; to output buffer&quot;);
                    smallestParcel++;
                    break;
                }
            }
            holdtrack++;
    }
    return true;
}

huangapple
  • 本文由 发表于 2020年4月10日 16:48:32
  • 转载请务必保留本文链接:https://java.coder-hub.com/61136903.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定