title: Is it Possible to implement timer task with Callable Thread in java?
body: <p>unlike common thread, a callable is a thread that allow a return variable, </p>
  
  <p>my question is can timertask implemented with callable thread? if yes, how does the code work?</p>
  
  <p>As Timer task is using void run() for it code, how can i used timer task with callable object because callable thread used object call(), not void run()</p>
  
  <p>As example, i need to implement thread which will return a boolean value (Callable thread can return a boolean value), and i need to made that thread process run periodically every 10 second (which is why i want to implement timer task)</p>
  
  <pre><code>public class test extends TimerTask implements Callable&lt;Boolean&gt;{
  
  public void run()  //from timer task thread
  {
    //timer task will only implement time task in here
    // i cant run my task here because my task have return boolean.
    // note that run() only accept void task.
  }
  
  public boolean call{  // from callable thread
    // i implement code here and end result will return true or false 
    // i have no idea how to instruct timer task
    // to keep execute my code here periodically
  
    //task processed . . .
    Boolean status = true;
  
  
  return status;
  }
  </code></pre>
  
  <p><strong>Answer</strong></p>
  
  <p>I assume not possibloe or highly discourage to implement timer task on callable thread</p>