Не понимаю что не нравится компилятору, при запуске, формально, все условия выполняются, но 2, 4, 5 и 6 условия горят красным, объясните, пожалуйста, чего именно от меня хотят в этой задаче
package com.javarush.task.task16.task1619;
/*
А без interrupt слабо?
*/
public class Solution {
public static void main(String[] args) throws InterruptedException {
Thread t = new Thread(new TestThread());
t.start();
Thread.sleep(3000);
ourInterruptMethod();
}
public static void ourInterruptMethod() throws InterruptedException {
throw new InterruptedException();
}
public static class TestThread implements Runnable {
public void run() {
Thread current = Thread.currentThread();
while (!current.isInterrupted()) {
try {
System.out.println("he-he");
Thread.sleep(500);
} catch (InterruptedException e) {
}
}
}
}
}