2:29 am - Friday April 19, 2019

Thread Example program for getState()

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

/**
*@author: candidjava.com
*@description: Thread Example program for getState()
*/
import java.lang.Thread;

public class ThreadDemo implements Runnable {

public void run() {

Thread.State state = Thread.currentThread().getState();
System.out.println("state = " + state);
}

public static void main(String args[]) {
Thread t = new Thread(new ThreadDemo());

t.start();
}
}

Output:
state = RUNNABLE

Filed in: Z-A All Java Codes

Comments are closed.