Добрый вечер, вывод соответствует условию, что делаю не так?
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);
if(clock.time >= 3.5){
clock.interrupt();
System.out.print("Прервано");
}
else {
System.out.println("Марш");
}
//add your code here - добавь код тут
}
public static class RacingClock extends Thread {
public RacingClock() {
start();
}
int time = 0;
public void run() {
while(numSeconds > 0){
System.out.print(numSeconds + " ");
numSeconds--;
time++;
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
//add your code here - добавь код тут
}
}
}