Java Thread isInterrupted() methodThe isInterrupted() method of thread class is an instance method that tests whether the thread has been interrupted. It returns the value of the internal flag either true or false. If the thread is interrupted then it will return true otherwise false. SyntaxReturnIt will return true if the thread has been interrupted otherwise returns false. ExampleTest it NowOutput: is thread interrupted..: false is thread interrupted..: false is thread interrupted..: true is thread interrupted..: false doing task....: 1 doing task....: 2 doing task....: 3 doing task....: 1 doing task....: 2 doing task....: 3 Next TopicJava Thread |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India