??????????????????????????????????μ?????timer????????????
?????÷??????new???timer?????д???timertask???????ɡ?
???????????£?
package comz.autoupdatefile;
import java.util.Timer;
import java.util.TimerTask;
public class M {
public static void main(String[] args) {
// TODO todo.generated by zoer
Timer timer = new Timer();
timer.schedule(new MyTask()?? 1000?? 2000);
}
}
class MyTask extends TimerTask {
@Override
public void run() {
System.out.println("dddd");
}
}
????????????????1???????????mytask??????????????Ρ?
?????????timer?????????????????????????????????????sleep??????????????????????????????
??????????????timertask??????????????????timertask???????runnable??????????????timer????????????????????????????????????????????