62,612
社区成员
发帖
与我相关
我的任务
分享
public static void main(String[] args) {
// TODO Auto-generated method stub
final Timer timer = new Timer();
timer.schedule(new TimerTask() {
private int i = 1;
private Calendar c = Calendar.getInstance();
public void run() {
if(c.get(Calendar.MINUTE)==10)
{
System.out.println("10分钟到了");
this.cancel();
timer.cancel();
}
}
}, new Date(), 1);
}