title: Possible to have a class implementing Runnable() to have a method that uses itself for a new Thread?
body: <p>Im trying to build a Task object that implements Runnable, that via a begin() method spawns a new Thread, using itself as the Runnable object in the Thread? </p>
  
  <p>The generic Task object itself will have various properties, and will be added to a collection / array of similar Task objects, that when certain properties in the Task match specific criteria, that the Task will be run, itself, in its own thread. The Task object itself will be extended, such that I can make a PurgeTask class, or a CleanTask class, etc..</p>
  
  <p>For example:</p>
  
  <pre><code>public abstract class Task implements Runnable {
  static final int ABOUT_TO_RUN = 0;
  static final int RUNNING = 1;
  static final int DONE_RUNNING = 2;
  
  int someProperty;
  int anotherProperty;
  
  int state = ABOUT_TO_RUN;           //lets start in a not ran state
  
  public abstract void run();
  
  //some other common methods I want here
  
  public void beginTask() {
      if (this.state == ABOUT_TO_RUN) {
          this.state == RUNNING;
          new Thread(this).start();   //Here is where my question refers too
          this.state == DONE_RUNNING;
      }
  }
  </code></pre>
  
  <p>And then...</p>
  
  <pre><code>public class CleanTask extends Task {
  
  public CleanTask() {
  }
  
  @Override
  public void run() {
      //some code that does a cleaning task in a database
  }
  }
  </code></pre>
  
  <p>Would this be possible? Or will the problems with an abstract Runnable class using itself in a new Thread?</p>