title: When a Java TimerTask is scheduled in a Timer, is it already "executing"?
body: <p>I would like to clarify something about TimerTask. When you have the code below:</p>
  
  <pre><code>timer.schedule(task, 60000);
  </code></pre>
  
  <p>where the task is scheduled to run in the next 1 minute, is the task object already executing? </p>
  
  <p>because somewhere in my code I called task.cancel() but it seems that the call doesn't prevent </p>
  
  <p>task to be executed. I even logged the return value from the call and it returns false.</p>
  
  <p>I came about my question when I read the documentation for the cancel method:</p>
  
  <blockquote>
    <p>Cancels the TimerTask and removes it from the Timer's queue.
    Generally, it returns false if the call did not prevent a TimerTask
    from running at least once. Subsequent calls have no effect. Returns true if the call prevented a scheduled execution from taking place, false otherwise.</p>
  </blockquote>
  
  <p>I believe I called cancel() before the 1 minute delay. But how come cancel returned false, </p>
  
  <p>is it [task] already executing?</p>
  
  <p>Hope you can give me clues/hints or even an explanation to this. Thanks SO!</p>