Java tutorial
//package com.java2s; public class Main { public static String getAllThreadNames() { Thread[] array = new Thread[Thread.activeCount()]; Thread.enumerate(array); String s = ""; for (Thread t : array) { if (t != null) { s += t.getName() + ", "; } } return s; } }