import java.util.*; public class Main { public static void main (String[] args){ Map dico = Thread.getAllStackTraces(); Set> tab = dico.entrySet(); Iterator> ite = tab.iterator(); for (; ite.hasNext(); ) { Map.Entry entry = ite.next(); Thread thread = entry.getKey(); StackTraceElement[] stackTrace = entry.getValue(); System.out.println(thread.getName() + " :"); for (StackTraceElement element : stackTrace) { System.out.println(" " + element); } System.out.println(); } } }