Here is my application:
public class NamedThread extends Thread { /* This will store name of the thread */ String name; @Override public void r
public static void main(String[] args) { System.out.println(Thread.activeCount()); //doSomething() }
The code above output 2
GC occupies a thread, so you get 2, instead of 1
This function is designed for debugging
If you run on debug mode, you would get 1