是否有一個命令可以退出內部for-loop中的if語句並讓它只通過內部的for-loop?是否可以退出if語句並返回到內部for-loop?
例如:
for (int i = 0; i < blah.length; i++) {
blh = scan.nextDouble();
blah[i] = blh;
if(scores[i] < MIN || scores[i] > MAX_SCORE) {
errFlag = true;
System.out.println("ERROR: Enter numbers in the range of " +
MIN + "-" + MAX_SCORE + "!");
System.out.print("ERROR: Enter all " + numStudents + " scores again: ");
errFlag = false;
}
}
什麼「返回到內部for-循環「意味着 –