Loading

continue Keyword

  • The continue keyword is used to skip one particular iteration if the specific condition is true.

Example:

package quipohouse;
public class ContinueStatement {
	public static void main(String[] args) {
		int i;
		for (i = 0; i < 5; i++) {
			if (i == 2) {
				continue;
			}
			System.out.println(i);
		}
	}
}

Output:

0
1
3
4