import java.util.*;
import java.text.*;
class TimerDemo
{
public static void main(String[] args) throws ParseException
{
Timer time = new Timer();
SimpleDateFormat sdf = new SimpleDateFormat("kk:mm:ss"); //请问"kk:mm:ss"这个格式定义的正确吗
Date date = sdf.parse("13:21:30"); //时间还没到,输出语句就先输出了,请问是我哪里写错了
time.schedule(new TimerTask()
{
public void run()
{
System.out.println("关机中。。。");
}
},date);
}
} |
|