BUT2/DEV/DEV3.2/TP06_Dictionnaires/Q1Main.java

19 lines
667 B
Java
Raw Normal View History

2023-11-20 13:22:30 +01:00
import java.util.*;
public class Q1Main{
public static void main(String args[]){
Map<Thread, StackTraceElement[]> listeThreadNul = Thread.getAllStackTraces();
Set<Map.Entry<Thread, StackTraceElement[]>> listeThread = listeThreadNul.entrySet();
for (Map.Entry<Thread, StackTraceElement[]> thread : listeThread) {
Thread clef = thread.getKey();
StackTraceElement[] valeur = thread.getValue();
System.out.println(clef.getName() + ":");
for (StackTraceElement item : valeur){
System.out.println(" " + item);
}
System.out.println();
}
}
}