title: Why arent the threads running concurrently?
body: <p>I am running a very simple multi thread program </p>
  
  <p><strong>Main program</strong></p>
  
  <pre><code>package javathread;
  
  
  public class JavaThread {
  
  
      public static void main(String[] args) 
      {
  
          JThread t1 = new JThread(10,1);
          JThread t2 = new JThread(10,2);
  
          t1.run();
          t2.run();
  
      }
  }
  </code></pre>
  
  <p><strong>JThread.java</strong></p>
  
  <pre><code>package javathread;
  
  import java.util.Random;
  
  public class JThread implements Runnable
  {
      JThread(int limit , int threadno)
      {
          t = new Thread();
          this.limit = limit;
          this.threadno = threadno;
  
      }
  
      public void run()
      {
          Random generator = new Random();
  
          for (int i=0;i&lt;this.limit;i++)
          {
              int num = generator.nextInt();
  
              System.out.println("Thread " + threadno + " : The num is " + num   );
              try
              {
              Thread.sleep(100);
              }
              catch (InterruptedException ie)
              {
  
              }
          }
  
      }
  
  
  
  
      Thread t;
      private int limit;
      int threadno;
  }
  </code></pre>
  
  <p>I expect both threads to run concurrently/parrallel , something similar to this picture</p>
  
  <p><img src="https://i.stack.imgur.com/ZCRLT.png" alt="enter image description here"></p>
  
  <p>Instead I am getting this where thread 1 runs first then thread 2 runs</p>
  
  <p><img src="https://i.stack.imgur.com/1xNUM.png" alt="enter image description here"></p>
  
  <p><strong>Can someone explain to me why this is happening ??</strong></p>
  
  <p><strong>How do i get the threads to run concurrently ??</strong></p>