import java.util.*;class ReminderTest
{
  Timer timer;
  public ReminderTest()
  {
     timer = new Timer();
     timer.schedule(new RemindTask(),3*1000,3*1000);
  }  class RemindTask extends TimerTask
  {
      public void run() {
          System.out.println("Time's up!");
  //timer.cancel(); //Terminate the timer thread
      }
  }  public static void main(String args[])
  {
System.out.println("About to schedule task.");
      Calendar calendar = Calendar.getInstance();
      calendar.set(Calendar.HOUR_OF_DAY, 21);
      calendar.set(Calendar.MINUTE, 35);
      calendar.set(Calendar.SECOND, 30);
      Date timeRun = calendar.getTime();
      System.out.println("Task scheduled.");
      new ReminderTest();
      System.out.println("over!");
  }
}