Multiple choice

What is the use of purge() method in Timer class?

  1. Terminate this Timer

  2. Schedule the specified task for execution at the specified time

  3. Remove all cancelled tasks from this timer’s task queue

  4. Remove all running tasks from this timer’s task queue

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The purge() method of Timer class removes all cancelled tasks from this timer’s task queue.