package test.run;
import java.util.Timer;
import java.util.TimerTask;
public class TimerTest {
public static void main(String[] args) {
class MyTimerTask extends TimerTask {
@Override
public void run() {
System.out.println("定制调度任务");
new Timer().schedule(new MyTimerTask(), 1000);
}
}
new Timer().schedule(new MyTimerTask(), 1000);
}
}