title: How can I pass parameter to a Java thread?
body: <p>I have a code in abstract class:</p>
  
  <pre><code>public abstract class Job implements Runnable{  
      public void start(Integer jobId) {                      
          try {
              new Thread(this).start();
          } catch (Exception e) {
              e.getMessage();
          }       
      }
  }
  </code></pre>
  
  <p>class code:</p>
  
  <pre><code>public class Test extends Job {
  
      @Override
      public void run() {
          for(int i = 0; i &lt; 5; i++) {
              try {
                  Thread.currentThread();
                  Thread.sleep(2000);
              } catch (InterruptedException e) {
                  e.printStackTrace();
              }
              System.out.println("TEST");
          }       
      }
  }
  </code></pre>
  
  <p>And in main I have:</p>
  
  <pre><code>public static void main (String[] args) throws MessagingException  
    {
        Test test = new Test();
        test.start(74); 
    }
  </code></pre>
  
  <p>So how can I pass parameter (jobId) from start method to run()?</p>