package ne;
public class c4 {
public static void main(String[] args) {
break; 终止当前循环语句
continue; 结束这一次循环,立即准备开启下一次循环
int ix = 1;
do {
System.out.println(ix++);
//Thread.currentThread().sleep(2000);
} while (true);
while (true) {
try {
System.out.printf("===================");
} catch (Exception e) {
break; //退出
}
continue; //跳过
}
int i = 100;
while (i <= 4) {
System.out.println(i++);
}
for (int j = 1; j <= 4; j++) {
System.out.println(j);
}
}
}
Java while dowhile语法
最新推荐文章于 2024-09-05 11:00:53 发布