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
You could implement ThreadFactory to construct the custom Thread classes and supply a ThreadGroup instance to get the counts from. By using ThreadFactory, each instance could contain its own ThreadGroup, making counts accessible based on the factory used.