Back to the 2026 paper

Module 1: Introduction to Java

20262m

Which statement terminates the current iteration of a loop and proceeds with the next iteration?

(i) break
(ii) return
(iii) continue
(iv) exit

Worked SolutionAI Assisted

Answer: (iii) continue

continue skips the remaining statements in the current loop iteration and moves to the next iteration. break exits the loop; return exits the current method.

for (int i = 1; i <= 5; i++) {
    if (i == 3) continue;
    System.out.print(i + " "); // 1 2 4 5
}

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.