com.xu.struct.BreakDemo01

package com.xu.struct;

public class BreakDemo01 {
public static void main(String[] args) {
int i=0;
while(i<100){
i++;
System.out.println(i);
if(i==30){
break;//只是跳出这个循环,不影响下面123的输出
}
}
System.out.println("123");//123
}

}

"D:\Program Files\Java\jdk1.8.0_281\bin\java.exe" "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2021.1\lib\idea_rt.jar=62858:D:\Program Files\JetBrains\IntelliJ 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
123

Process finished with exit code 0

上一篇:com.xu.operator.Demo07


下一篇:com.xu.struct.DoWhileDemo01