1.线程状态
通过下述代码段获取线程状态:
public class test
{
public static void main(String[] args) {
for (Thread.State state : Thread.State.values()) {
System.out.println(state);
}
}
}
得出结果:
2.线程状态解析(6种状态)
***得到当前线程的状态:thread.currentThread().getState();