I want to know how many active threads are there for a particular Thread class. Lets say I have a class T which extends thread. In some other class (Ex: Demo) , I want to get t
Try to use ThreadPoolExecutor. You can extend the ThreadPoolExecutor and counts the number of threads by calling getActiveCount().
ThreadPoolExecutor
getActiveCount()
http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html