package 第十一章;

import java.util.*;
import java.util.TimerTask;

public class TimerTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws InterruptedException{
		// TODO Auto-generated method stub
		Timer timer=new Timer();
		TimerTask task =new TimerTask(){

			@Override
			public void run() {
				// TODO Auto-generated method stub
				System.out.println("现在的时间是:"+new Date().toLocaleString());
			}};
			timer.schedule(task,10,1000);
	}

}

 

相关文章:

  • 2021-09-08
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
  • 2022-12-23
  • 2021-10-11
  • 2021-07-22
相关资源
相似解决方案