我的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();
}