Tutoriallearn.com

Easy Learning


Home

Search Tutoriallearn.com :



getSate() method of thread

    getState() method returns state of the thread.

Example

 public class  ExmpGetState extends Thread {
    public void  run()
    {
        System.out.println("Thread status is "+Thread.currentThread().getState());
        
    }
    
    public static void  main(String args[]) {
     
    ExmpGetState t1 = new ExmpGetState();
        
         t1.start();
     
    }
}

Output

Thread status is RUNNABLE




© Copyright 2016-2025 by tutoriallearn.com. All Rights Reserved.