The continue Keyword in Java


continue skips the current iteration of a loop and proceeds to the next iteration.

Source Code

for (int i = 0; i < 5; i++) {
    if (i == 3) {
        continue; // Skip the rest of the code inside the loop for this iteration
    }
    System.out.println(i);
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments