线程休眠_模拟倒计时

package com.qiliang.demo07;
// 线程休眠_模拟倒计时
public class demo01 {

    public static void main(String[] args) throws InterruptedException {
        int i = 10;
        while (true){
            Thread.sleep(1000);
            System.out.println(i--);
            if(i<=0){
                break;
            }
        }
    }
}
posted @ 2020-04-28 14:49  阿亮在努力  阅读(150)  评论(0)    收藏  举报