Example as you expected in this link Timer will be running for
ever in our application untill application is closed or When
there is no more job will be available to assign or Schedule.
TimerTask -- this is the task which has some functionality which
is to be run based on time or duration. In Timer we will assgin
TimerTask to run for particular duration or to start its run at
particular duration. Please Understand how it works then apply
with applet or any others 1,The GCTask class extends the
TimerTask class and implements the run() method. 2,Within the
TimerDemo program, a Timer object and a GCTask object are
instantiated. 3, Using the Timer object, the task object is
scheduled using the schedule() method of the Timer class to
execute after a 5-second delay and then continue to execute
every 5 seconds. 4,The infinite while loop within main()
instantiates objects of type SimpleObject (whose definition
follows) that are immediately available for garbage collection.
public class GCTask extends TimerTask public