How to observe the state of threads in java
This article mainly introduces how to observe the state of threads in java. It is very detailed and has a certain reference value. Friends who are interested must finish it!
Observe the state of the thread
State state=Thread object .getState ()
Int num=Thread.activeCount (); / / current number of active threads
Public class n {public static void main (String [] args) throws InterruptedException {Thread t = new Thread (())-> {for (int iTuno)