title: Ordering threads to run in the order they were created/started
body: <p>How can i order threads in the order they were instantiated.e.g. how can i make the below program print the numbers 1...10 in order.</p>
  
  <pre><code>public class ThreadOrdering {
      public static void main(String[] args) {
  
          class MyRunnable implements Runnable{
              private final int threadnumber;
  
              MyRunnable(int threadnumber){
                  this.threadnumber = threadnumber;
              }
  
              public void run() {
                  System.out.println(threadnumber);
              }
          }
  
          for(int i=1; i&lt;=10; i++){
              new Thread(new MyRunnable(i)).start();
          }
      }
  }
  </code></pre>