Java Continue
continue skips the rest of this round and goes to the next round. The loop does not end. Useful to ignore bad values: skip negatives, skip one id.
In a for loop, after continue the update (i++) still happens. Then the condition is checked again. break exits; continue keeps looping.
Same sample loop, continue at i == 3 vs break at i == 3 — outputs are different. Interviewers love that comparison. Don’t say continue “stops the loop”.
Let's take this on the board with one tiny Main class — no extra files. Java Continue — output: 1, 2, 4, 5. When i is 3, continue skips that print and goes to i++. Start from main, go line by line, and stop at each print. That output is the proof for Continue.
Same loop: continue at i == 3 vs break. Compare output.