Bonjour,
Comment je peux executer plusieurs thread en méme temps.
merci d'avance.
Bonjour,
Comment je peux executer plusieurs thread en méme temps.
merci d'avance.
Bonjour,
Question courte, réponse courte :
Affiche :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 public static void main(String[] args) { System.out.println("Début thread courrant : "+Thread.currentThread().getId()); Thread thread = new Thread(new Runnable() { public void run() { System.out.println("Thread secondaire : "+Thread.currentThread().getId()); } }); thread.start(); System.out.println("Suite thread courrant : "+Thread.currentThread().getId()); }
Romain.Début thread courrant : 1
Suite thread courrant : 1
Thread secondaire : 9
Partager