Javatpoint Logo
Javatpoint Logo

Java Timer purge() Method

The purge() is the method of Timer class. It is used to cancel the tasks present in the TimerTask Chain.

Syntax

Return

This method returns the number of tasks removed from the queue.

Example 1

Test it Now

Output:

Task is on
Task is on
Task is on
Task is on
Task is on
Task is stop
purge value of Task:0

Next TopicJava Timer




Help Others, Please Share

facebook twitter pinterest