DateTask.java

import java.util.*;
public class DateTask extends TimerTask {
  String msg;
  public DateTask(String msg) {
    this.msg = msg;
  }
  public void run() {
    System.out.println(Thread.currentThread().getName()
               + " " + msg + ": " + new Date());
  }
}