Home » JAVA Programming » Multithreading » Question
  1. What is the output of the thread in output of this program?
    public class Output
    {
    public static void main(String args[])
    {
    Thread thread = Thread.currentThread();
    System.out.println(thread.isAlive());
    }
    }
    1. True
    2. 0
    3. 1
    4. False
    5. None of these
Correct Option: A

Thread t is seeded to currently program, hence when you run the program the thread becomes active & code ‘thread.isAlive’ returns true.



Your comments will be displayed only after manual approval.