- Hands-On Object:Oriented Programming with C#
- Raihan Taher
- 107字
- 2021-07-02 12:44:36
Continue
This is used to invoke the next iteration. The contextual keyword allows the developer to continue to the next step without executing any further code in the block.
Now, let's look at how we can use both of these contextual statements in our program:
var x = 0;
while(x<=10)
{
x++;
if(x == 2)continue;
Console.WriteLine(x);
if(x == 5) break;
Console.WriteLine("End of loop body");
}
Console.WriteLine($"End of loop, X : {x}");
The preceding code will skip execution of the body for the iteration value, 2, because of the continue statement. The loop will execute until the value of x is 5 because of the break statement.
推薦閱讀
- 計算機網絡
- 多媒體CAI課件設計與制作導論(第二版)
- Computer Vision for the Web
- GeoServer Cookbook
- PyTorch自動駕駛視覺感知算法實戰
- Arduino by Example
- Java從入門到精通(第4版)
- 基于Swift語言的iOS App 商業實戰教程
- 網絡爬蟲原理與實踐:基于C#語言
- Android 應用案例開發大全(第3版)
- SharePoint Development with the SharePoint Framework
- 深入淺出PostgreSQL
- 軟件測試技術指南
- Fast Data Processing with Spark(Second Edition)
- Python機器學習之金融風險管理