In this example we will show the method to continue a loop in Java.
Source Code
package com.beginner.examples;
public class ContinueLoop {
public static void main(String[] args) {
for (int k = 0; k < 3; k++) { // loop
if (k == 1) continue; // continue
System.out.println(k);
}
}
}
Output:
0
2