The continue statement passes control to the next iteration of its closed iteration statement.
The continue statement is similar to the break statement. The difference is that it is not to exit a loop, but to start a new iteration of the loop. That is, do not execute the code after the closed iteration statement continue and continue the loop.
The continue statement can only be used in the loop body of the while statement, do/while statement, for statement, and if statement. It may cause errors when used elsewhere!
In other words, the continue statement is used to execute the flow statement to skip the remaining part of the loop body and continue to execute the next loop.
Example:
In this example, the counter is initially counted from 1 to 10, but by using the continue statement with the expression I <9), the statement between the end of the continue and for loop body is skipped.
Using System; class ContinueTest {static void Main) {for int I = 1; I <= 10; I ++) {if I <9) {continue;} Console. writeLinei) ;}} output: 910
This article is from the blog "xuefei birds", please be sure to keep this source http://zhilian.blog.51cto.com/3059567/1299619