The continue statement is a statement composed of the keyword continue plus a semicolon. The continue statement can be used in the loop body.
In a loop, if the continue statement is executed in a certain loop, then the loop will end, that is, the statements following the continue statement in the loop body of this loop will no longer be executed, and the next loop will be executed.
Example:
publicclassMain{publicstaticvoidmain(String[]args){for(inta=1;a<10;a=a+1){if(a%2==0){continue;}System.out.print(a);System .out.print(n);}}}
The running results are as follows:
13579