подскажите где ошибка, или как ее искать (есть способы найти ошибку, в подобном этому случае, не вникая в код)
package com.javarush.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();//add your code here - добавь код тут
}
public static class RacingClock extends Thread {
public RacingClock() {
start();
}
public void run() {
while (true) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
numSeconds--;
if (numSeconds == 3) {
System.out.println("3 2 1 Марш!");
break;//add your code here - добавь код тут
}
if (numSeconds == 4) {
System.out.println("4 3 2 1 Прервано!");
break;
}
}
}
}
}