当前位置:网站首页>Jump statement and debugger
Jump statement and debugger
2022-07-23 10:47:00 【Raise your eyes and look far away】

break( Change program control flow )
Action scenario :switch Select structure and cycle structure
effect :
stay switch Encountered in the selection structure break, End the whole switch structure , perform switch Select the code behind the structure ;
Encountered in the loop structure break, Then all subsequent operations of the whole cycle structure are ended , Execute the code after the loop structure
Be careful :
break General combination if Select statements to use together
// Cyclic output 1-20, When output to 10, All the following numbers are no longer output
for (int i = 1; i <=20; i++) {
System.out.println(i);
// Judge i Value , See if it has arrived 10, If it comes to 10 了 , It should end the whole for loop
if(i==10){
break;// End the whole thing for loop
}
}
continue
Action scenario : It can only act in the circular structure
effect :
End the present ( This time ) Cycle subsequent operations , Continue with the next cycle
Be careful :
continue General combination if Select statements to use together
// Cyclic output 1-20, No output 10
for (int i = 1; i <=20; i++) {
if(i==10){
continue;
}
System.out.println(i);
}contrast break and continue
Use occasion
break Commonly used in switch In structure and cyclic structure
continue Generally used in circular structures
effect ( In cyclic structure )
break Statement terminates a loop , The program jumps to the next statement outside the loop block
continue Jump out of this cycle , Enter next cycle
The same is true of the double cycle
return: End the execution of the current method and exit , Return to the statement that called the method
Why do you need program debugging
Errors sometimes occur in the process of writing programs , But it's hard to find and locate errors , Is there a good way ?
Find program errors by reading code or adding output statements
When the program structure becomes more and more complex , Special techniques are needed to find and locate errors , Namely “ Program debugging ”
What is program debugging
When the program goes wrong , We hope so
When the program is executed, it flashes and ends , How to make the program run step by step ?

The breakpoint : Lines of code where the program pauses
To set breakpoints : Double click the number in the code line
To test a program , You need to set breakpoints at the beginning and end

After setting the breakpoint , Click on this little beetle chart (debug), You can operate the test program

边栏推荐
- NFT数字藏品版权如何保护?
- 解决servlet中post请求和get请求中文乱码现象
- Exciting metauniverse! Wealth outlet of next generation Internet
- PyQt5_QListWidget分页多选控件
- Data warehouse: workflow design and Optimization Practice
- 写驱动程序的时候warning LNK4210报错
- [unity] avpro uses stepping pits, and the editor mode uses video playback. The video cannot be played after packaging
- 12 个适合做外包项目的开源后台管理系统
- 04_ue4进阶_物理碰撞入门和发射火球
- Li Hongyi machine learning 2022-hw1
猜你喜欢

C# 客户端程序调用外部程序的3种实现方法
![[warning] recognizing corrupt image/label during yolov5 training: [errno 2]...... it is impossible to complete the training data set. I will take you to solve it quickly](/img/14/ac1a600ccdd3e7d4c8e5c64087648d.png)
[warning] recognizing corrupt image/label during yolov5 training: [errno 2]...... it is impossible to complete the training data set. I will take you to solve it quickly

【Unity】AVPro使用踩坑,编辑器模式使用视频播放正常,打包后视频无法播放的问题

中国经济网:“元宇宙”炙手可热

【Delphi】制作控件面板安装图标的简单方法(译)

推荐一款 Shell 装逼神器,已开源!网友:真香。。。

理解ASP.NET Core - 基于Cookie的身份认证(Authentication)

04_ UE4 advanced_ Introduction to physical collision and firing fireballs

Comprehensive experiment of realizing private network interworking under mGRE environment

Rapid SQL all platforms high performance SQL code
随机推荐
Figure 8 sequence of crystal head connection of network cable
优化.NET 应用程序 CPU 和内存的11 个实践
网线水晶头接法图解8根顺序
添加信任列表
Openvino Datawhale
编译构建工具-bazel
推荐一款 Shell 装逼神器,已开源!网友:真香。。。
SQLZOO——SELECT from WORLD Tutorial
PyQt5_QListWidget分页多选控件
Clion + mingw64 configure C language development environment visual studio installation
跳转语句与调试程序
Flutter 运行flutter pub get 报错“客户端没有所需特权“
交换机Exchanges
Redis pseudo cluster one click deployment script - pro test available
300 questions, Lecture 6, quadratic form
12 个适合做外包项目的开源后台管理系统
Chapter 4: runtime data area - shared space
Basic knowledge of C language (I)
2022/7/22
第12届 蓝桥杯 嵌入式设计与开发项目