The boolean value false will be returned if 'Thread.interrupted' or 'Thread.isInterrupted' is invoked after the InterruptedException has been thrown.
why this statement is TRUE!!!? isn't it suppose that calling 'Thread.interrupted()' return the state of the thread? my second question is, why calling 'isInterrupted()' doesn't cause a compile error... i mean isn't this method is supposed to return a boolean value? shouldn't it be called like : 'boolean b = isInterrupted()'?
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
Please read carefully Thread.interrupt We can use isInterrupted() or interrupted() to test the interrupted status of thread that is performing a lengthy task to know if other thread ordered this thread to stop its lengthy job. If the thread is waiting, joined, or sleeping the exception handler will execute if other thread interrupted it in that state. Then the thread can abandon its task. In that case we already know that thread was interrupted. Thus there is no need of checking with such methods.