谁能帮助我吗?
package zh.codegym.task.task16.task1617;
/*
比赛倒计时
*/
public class Solution {
public static volatile int numSeconds = 3;
public static void main(String[] args) throws InterruptedException {
RacingClock clock = new RacingClock();
Thread.sleep(3500);
clock.interrupt();
}
public static class RacingClock extends Thread {
Thread thread=Thread.currentThread();
public RacingClock() {
start();
}
public void run() {
boolean T=false;
if(numSeconds>=4) T=true;
while (!thread.isInterrupted()){
try {
for(;numSeconds>0;numSeconds--){
Thread.sleep(1000);
System.out.print(numSeconds+" ");
}
if(!T) {
System.out.print("跑! ");
thread.interrupt();
}
}catch (InterruptedException e){
System.out.println("中断! ");
}
}
}
}
}