I want to close all thread which I started previously.
Thread.currentThread() gives me current thread, but what about others? How can I get them?
I think Thread.activeCount() returns the count of active threads in thread’s thread group, but I does not use ThreadGroup,
I just started threads using Thread thread = new Thread(new MyRunnable()).
So how can I achieve this?
thanks in advance…
You can use an ExecutorService instead which combines a thread pool with a queue of tasks.