[阅读: 332] 2006-05-15 01:06:01
import java.util.*;
public class Hi {
public static void main(String args[])
throws java.io.IOException {
TimerTask task = new TimerTask() {
public void run() {
System.out.println("Hi");
}
};
Timer timer = new Timer();
timer.schedule(task, 0, 500);
System.out.println("Press ENTER to stop");
System.in.read(new byte[10]);
timer.cancel();
}
}
这个不断的干.