Bonjour,
Comment je peux executer plusieurs thread en méme temps.
merci d'avance.
Version imprimable
Bonjour,
Comment je peux executer plusieurs thread en méme temps.
merci d'avance.
Bonjour,
Question courte, réponse courte :
Affiche :Code:
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.Citation:
Début thread courrant : 1
Suite thread courrant : 1
Thread secondaire : 9