Please see below code for Continue Statement – It is used for returning control to loop for next increment 

				
					package practice;

public class ContinueStatment {

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

	}

}

				
			

Explaination – once i become 3 the loop will not print 3 , instead it will increment i and print 4.

0
1
2
4

Scroll to Top