Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to go to next iteration of while loop java

/* Use the continue statement to skip (i.e. jump to the end of)
a loop iteration. */
int x = 0;
while (++x < 6){
	if (x == 3){
    	continue; //use this
    }
	System.out.print(x + " ");
}
// result: 1 2 4 5 
 
PREVIOUS NEXT
Tagged: #iteration #loop #java
ADD COMMENT
Topic
Name
7+6 =