I am using java.util.Timer class and I am using its schedule method to perform some task, but after executing it for 6 times I have to stop its task.
java.util.Timer
How
timer.cancel(); //Terminates this timer,discarding any currently scheduled tasks. timer.purge(); // Removes all cancelled tasks from this timer's task queue.