Does a thread need to be in a RUNNABLE state before it can be interrupted?
问题 Is it necessary for a thread in java to be in ready state before it gets interrupted by interrupt method? I tried to check this by typing the above given code below. class MyThread extends Thread { public void run() { try { for(int i =0;i<10;i++) { System.out.println("I am lazy thread"); Thread.sleep(2000); } } catch(InterruptedException e) { System.out.println("I got interrupted"); } } } public class SleepAndInterruptDemonstrationByDurga { public static void main(String[] args) { MyThread t=