Précédent Remonter Suivant


Thread démon
public class DaemonSimple extends Thread {
  public DaemonSimple() {
    setDaemon(true); // doit etre avant start()
    start();
  }
  public void run() {
    while(true) {
      try { sleep(100);
      } catch (InterruptedException e) {
        throw new RuntimeException(e);
      }
      System.out.println(this);
    }
  } ...

- 33 -

  Alain Bouju Thread


Précédent Remonter Suivant