I have a thread in Java which calls
t.interrupt();
making t (a different thread) be interrupted. I want the \"t\" thread to then catch an
Rather than catching InterruptedException you can call Thread.interrupted() or Thread.getCurrentThread().isInterrupted() (the former will clear the interrupted flag, the latter will not), which will return true if the interrupted flag is set. You can only catch InterruptedException if you've called a method that throws it, like sleep