Introduction
Java Timer and TimerTask are used to schedule tasks in the future. TimerTask is an abstract class that implements Runnable
interface which helps to schedule tasks in Timer class. We can define a task using TimerTask class and schedule it using Timer class. Timer uses background threads for scheduling tasks.