所以我做了一个计时器,但是现在我想当计时器变为0时打印出“动臂”该怎么办?
public class Main {
static Thread thread = new Thread();
public static void main(String[] args) throws InterruptedException {
for(int i = 60;i>=0;i--) {
thread.sleep(1000L);
System.out.println(i);
}
}
}
答案 0 :(得分:0)
尝试以下操作:
static Thread thread = new Thread();
public static void main(String[] args) throws InterruptedException
{
for(int i = 60;i>=0;i--)
{
thread.sleep(1000);
System.out.println(i);
}
System.out.println("boom");
}