My CheckStatus (TimerTask) is not stopping when I call cancel() inside the run method. this.cancel() also does not work. What am I doing wrong?

```
import java.util.TimerTask;
class CheckStatus extends TimerTask {
   int s = 3;
   public void run() {
      if (s > 0)
      {
         System.out.println("checking status");
         s--;
      }
      else
      {
         System.out.println("cancel");
         cancel();
      }
   }
}

```

Heres my driver

```
import java.util.*;
class Game {
   static Timer timer;
   static CheckStatus status;

   public static void main(String[] args) throws InterruptedException {        
      CheckStatus status = new CheckStatus();
      timer = new Timer();
      timer.scheduleAtFixedRate(status, 0, 3000);
   }  
}

```