死循环

 1 package day03;
 2 /*
 3  死循环格式
 4  for死循环:
 5      for(;;){
 6 
 7      }
 8  while死循环格式:
 9     while(true){
10     }
11  do while死循环格式:
12     do{
13     }
14  while(true);
15  */
16 public class DeadCircle {
17 
18     public static void main(String[] args) {
19         for(;;){
20             System.out.println("For keeping");
21         }
22         while(true){
23             System.out.println("while keeping");
24         }
25         do{
26             System.out.println("do kepping");
27         }
28         while (true);
29         System.out.println("哈哈哈哈");
30     }
31 }

执行结果:

posted @ 2020-12-29 09:39  Eleanor123  阅读(233)  评论(0编辑  收藏  举报