4. Timer In Java
java.util.Timer
• Timer()
• void schedule(TimerTask, Date) //Schedules specified task for execution at the specified time.
• void schedule(TimerTask, Date, long) //Schedules specified task for repeated fixed-delay execution,
beginning at the specified time. Long is time in milliseconds between successive task executions.
• void schedule(TimerTask, long) //Schedules the specified task beginning after the specified delay.
• void schedule(TimerTask, long, long) //Schedules the specified task for repeated fixed-delay execution,
beginning after the specified delay.
• void cancel() //Terminates this timer, discarding any currently scheduled tasks.
java.util.TimerTask
• TimerTask()
• void run() //The action to be performed by this timer task.
• boolean cancel() //Cancels this timer task.
Instructor: Tanzila Kehkashan
4