标签:blog ar java sp div on log 代码 bs
break:结束整个循环体
continue:结束本次循环
代码说明:
public static void main(String[] args) { int x=0; while(x++ < 10) { if(x == 3) { break; } System.out.println("x="+x); } int y=0; while(y++ < 10) { if(y == 3) { continue; } System.out.println("y="+y); } }
输入:
x=1
x=2
y=1
y=2
y=4
y=5
y=6
y=7
y=8
y=9
y=10
标签:blog ar java sp div on log 代码 bs
原文地址:http://www.cnblogs.com/smilefortoday/p/4026894.html