Java examples for java.lang:Thread
Returns total number of active threads in a string with header.
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { System.out.println(getThreadCountString()); }//from w w w . j av a 2 s . c o m /** * Returns total number of active threads in a string with header. */ public static String getThreadCountString() { return "Total number of active threads: " + Thread.activeCount(); } }