
The java.util.TimerTask class represents a task that can be scheduled for one-time or repeated execution by a Timer.
Following is the declaration for java.util.TimerTask class −
public abstract class TimerTask extends Object implements Runnable
| Sr.No. | Constructor & Description |
|---|---|
| 1 | protected TimerTask() This constructor creates a new timer task. |
| Sr.No. | Method & Description |
|---|---|
| 1 | boolean cancel()
This method cancels this timer task. |
| 2 | abstract void run()
This method represents the action to be performed by this timer task. |
| 3 | long scheduledExecutionTime()
This method returns the scheduled execution time of the most recent actual execution of this task. |
This class inherits methods from the following classes −