// Mise en evidence de la necessite de l'exclusion mutuelle public class PingPong2 extends Thread { private String texte; int temps; public PingPong2(String texte, int temps) { this.texte = texte; this.temps = temps; } // affichage du texte caractere par caractere public void run() { for (int i = 0; i < texte.length(); i++) { System.out.print(texte.charAt(i)); try { sleep(temps); } catch (InterruptedException e) { } } } public static void main(String args[]) { new PingPong2("Ping ", 100).start(); new PingPong2("Pong ", 100).start(); } } // serveur1-1.labri.u-bordeaux.fr> /opt/prog/jdk1.2/bin/java PingPong // PPionngg