The continue keyword skips the current iteration of a loop and continues with the next iteration.
Source Code
for (int i = 0; i < 10; i++) {
if (i == 5) {
continue; // Skips the rest of the loop body when i is 5
}
System.out.println(i);
}
Use continue to skip specific iterations of a loop based on a condition.