1. suppose a
thread is in waiting state, and another thread invokes
interrupt on this thread, InterruptedException is thrown and the thread
is move to runnable state. the same when notify is invoked.
my question is: when is the InterruptedException block specified in
the catch construct executed. is it
-- after the thread scheduler enables this thread for running
OR
-- immediately on invocation of notify or interrupt() methods.
because according to my understanding, for sleep () method, interrupt()
causes InterruptedException, and this exception block is executed
AFTER the thread scheduler enables the thread for running.
2.does it mean that the code of resumption of thread always is always
specified in the catch(InterruptedException e) block?
3.also, since the above exception is a checked exception, we will
ALWAYS have to declare methods like sleep() , wait() etc. in a
try-catch(InterruptedException e) block or else the compiler will
enforce an error, right?
please specify the steps taken after invocation of interrupt()
please help
chetan