Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

What are the two ways to check if a Thread has been interrupted?

Pragya Keshap answered on February 4, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • Always terminate the thread which it is interrupted

  • What are the two ways to check if a Thread has been interrupted?

    0

    These are the two ways to check for thread interruption:

    1. In Java, a Thread can call Thread.interrupted() method to

    check if it has been interrupted or not.

    2. The other option is to call isInterrupted() method of

    Thread class to check if it has been interrupted or not.

    https://learning.oreilly.com/library/view/java-threads-second/1565924185/ch04s05.html

    Popularity 1/10 Helpfulness 1/10 Language java
    Source: Grepper
    Tags: java
    Link to this answer
    Share Copy Link
    Contributed on Feb 04 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.