The continue statement skips the rest of the current iteration and jumps back to the loop's condition check. The loop itself keeps running.
for (int i = 0; i < 10; i++) {
if (i % 2 == 0) {
continue;
}
System.out.println(i);
}
This prints only the odd numbers: , , , , . When i is even, continue fires and println is skipped. But the loop doesn't end. It goes back to the update step (i++), checks the condition, and starts the next iteration.
The difference from break is that continue skips one iteration, while break ends the entire loop. If you confuse them, you'll either stop too early or not stop at all.