Java provides class called Timer using which you can schedule task at specific intervals.
Signature of Schedule method of Timer class follows as
schedule(TimerTask task, Date firstTime, long period)
Here, task is the task to be executed
firstTime is firstTime at which task to be executed first
period is interval time in milliseconds at which task will be executed automatically at this interval.
Signature of Schedule method of Timer class follows as
schedule(TimerTask task, Date firstTime, long period)
Here, task is the task to be executed
firstTime is firstTime at which task to be executed first
period is interval time in milliseconds at which task will be executed automatically at this interval.