day03-死循环

This commit is contained in:
2026-07-18 10:21:18 +08:00
parent 63783a2b16
commit 768186e695
+23
View File
@@ -0,0 +1,23 @@
package com.inmind.break06;
/*
死循环:循环条件永远满足true
如何结束死循环:break
*/
public class Demo12 {
public static void main(String[] args) {
//最常见的死循环
/*while (true) {
}*/
//for的死循环
/*for(;;){
}*/
//do-while的死循环
do{
System.out.println(3);
}while(true);
// System.out.println("程序结束");
}
}