# state
线程状态
@Slf4j
public class Demo {
public static void main(String[] args) throws ExecutionException, InterruptedException {
log.info("main run..");
Thread thread = new Thread(() -> log.info("thread run.."), "custom-name");
log.info("{}", thread.getState());
thread.start();
log.info("{}", thread.getState());
}
}
//22:49:56.278 [main] INFO com.gao.Demo - main run..
//22:49:56.323 [main] INFO com.gao.Demo - NEW
//22:49:56.324 [main] INFO com.gao.Demo - RUNNABLE
//22:49:56.324 [custom-name] INFO com.gao.Demo - thread run..