gpt4 book ai didi

java - Java 中的嵌套 while 循环

转载 作者:行者123 更新时间:2023-11-29 07:10:14 26 4
gpt4 key购买 nike

<分区>

我的 Java 程序中有一些嵌套的 while 循环,我遇到了一个大问题。根据我调试过的代码,检查第二个 while 循环语句一次,然后永远退出循环。我不知道为什么会这样,所以我将在此处发布代码:

while (current != null) {
if(id == current.getMovie().getId()) {
movieExists = true;
movie = current;
while (checkCurrent == movie) {
showingPointer = checkCurrent.getMovie().getLinkHead();
while (showingPointer != null) {
if (cal.compareTo(showingPointer.getShowing().getShowingCalendar()) == 0) {
return false;
}
showingPointer = showingPointer.getNext();
}
checkCurrent = checkCurrent.getNext();
}
}
current = current.getNext();
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com