class TVProgThread extends Thread {
  // Konstruktor
  public TVProgThread(String name) { 
    super(name);
  } 
  // run-Methode (Schleife mit Zufalls-Wartezeiten)
  public void run() {	
    for (int i = 1; i <= 5; i++) {
      System.out.println(getName() + " zum " + i + ". Mal");
      try {
        sleep((int)(Math.random() * 1000));
      } 
      catch (InterruptedException e) {
      } 
    } 
    System.out.println(getName() + " FERTIG!"); 
  }
}
