当前位置:网站首页>C# break continue return 三者区别
C# break continue return 三者区别
2022-06-12 09:52:00 【喝口我的爽肤水】
break:执行break操作,跳出所在的当前整个循环,到外层代码继续执行。通常,是离当前break最近的一个函数体的循环会被跳出。即一次只能结束一种循环
continue:执行continue操作,跳出本次循环,从下一个迭代继续运行循环,内层循环执行完毕,外层代码继续运行。字段后面不需要跟着参数。即结束的是本次循环,并将接着开始下一次循环。
return:执行return操作,直接返回函数,所有该函数体内的代码(包括循环体)都不会再执行。在需要返回值的情况下,后需要紧跟一个返回值,用于提供给对应方法所需的返回值。即同时结束其所在的循环和其外层循环。
边栏推荐
- The white paper "protecting our digital heritage: DNA data storage" was released
- Do you know how to improve software testing ability?
- 5种最常见的CEPH失败方案
- Briefly introduce the difference between threads and processes
- The onbindviewholder of recyclerview is called twice at the same time
- 电阻的作用有哪些?(超全)
- MySQL index FAQs
- PandoraBox 使用防火墙规则定义非上网时间
- MySQL优化之慢日志查询
- Implementation of hotspot reference
猜你喜欢
随机推荐
C # getting started series (12) -- string
《要领》读书笔记
7-13 underground maze exploration (adjacency table)
使用Visual Studio 2017创建简单的窗口程序
Abstract classes and interfaces
Crazy temporary products: super low price, big scuffle and new hope
Microservice gateway
MySQL index
7-13 地下迷宫探索(邻接表)
Auto.js学习笔记9:脚本引擎使用,启动指定路径脚本文件和关闭等基础方法
Dazzle the "library" action - award solicitation from the golden warehouse of the National People's Congress - high availability failover and recovery of kingbasees cluster
六月集训(第12天) —— 链表
NiO principle
【云原生】具体指什么呢---此文和大伙儿分享答案
III Regular expression to finite state automata: NFA to DFA
Introduction to applet
ThreadLocal
The Dragon Boat Festival is in good health -- people are becoming more and more important in my heart
TAP 系列文章3 | Tanzu Application Platform 部署参考架构介绍
SAP Hana error message sys_ XSA authentication failed SQLSTATE - 28000
![[cloud native | kubernetes] kubernetes networkpolicy](/img/8b/9260fc39d3f595cdc2689a3ab26bd7.png)








