day03-死循环

This commit is contained in:
2026-04-25 14:15:52 +08:00
parent 52a7ab343c
commit 8abe22ef7f

View File

@@ -0,0 +1,25 @@
package com.inmind.control06;
/*
死循环:循环条件永远满足,经常与break关键字配合使用
*/
public class Demo14 {
public static void main(String[] args) {
//死循环
int i = 10;
/*while (true) {//常用于一些不停执行的程序
System.out.println(1);
}*/
//for的死循环
/*for (; ;) {
}*/
//do-while 死循环
do {
} while (true);
}
}