Posted By:
Sean_Owen
Posted On:
Friday, April 23, 2004 12:44 PM
What Bill said -- here's an example:
public class MyTimerTask extends TimerTask {
private String aValue;
public MyTimerTask(String aValue) {
this.aValue = aValue;
}
public void run() {
System.out.println(aValue);
}
}
...
// pass "foo" to your TimerTask
MyTimerTask tt = new MyTimerTask("foo");
// schedule the task...
This is a pattern than comes up a lot, I think.