Валидатор говорит, что я не создал экземпляр класса, но как тогда он пропустил вызов методов на этом экземпляре?
package com.javarush.task.task16.task1618;
/*
Снова interrupt
*/
public class Solution {
public static void main(String[] args) throws InterruptedException {
//Add your code here - добавь код тут
Thread test = new TestThread("test");
test.start();
test.interrupt();
}
//Add your code below - добавь код ниже
public static class TestThread extends Thread {
public TestThread(String name) {
super(name);
}
public void run() {
System.out.println("TestThread is started");
}
}
}