Thread.activeCount()返回值
public class ThreadActiveCountTest { public static void main(String[] args) { System.out.println(Thread.activeCount()); } }
Thread.activeCount()此方法返回活动线程的当前线程的线程组中的数量。
IDE返回的值不相同,Eclipse中返回1,Intellij idea中返回2。
public class ThreadActiveCountTest { public static void main(String[] args) { System.out.println(Thread.activeCount()); } }
Thread.activeCount()此方法返回活动线程的当前线程的线程组中的数量。
IDE返回的值不相同,Eclipse中返回1,Intellij idea中返回2。