public class RightWayInterrupted{
public static void main(String[] args) throws InterruptedException {
Thread thread = new Thread(new Thread1());
thread.start();
thread.interrupt();
System.out.println(thread.isInterrupted()); System.out.println(thread.isInterrupted());
thread.join();
} }
class Thread1 implements Runnable{ @Override public void run() { } }