62,614
社区成员
发帖
与我相关
我的任务
分享
public class TimerTest {
public static void main(String[] args) throws InterruptedException {
new TimerTest().execute();
}
public void execute(){
java.util.Timer timer = new java.util.Timer();
MyTimerTask m = new MyTimerTask();
java.util.Date date = new java.util.Date();
timer.schedule(m, date, 1000);
}
}
class MyTimerTask extends java.util.TimerTask{
public void run(){
//需要的操作
}
}