title: How to run a thread just after the previous one in Java
body: <p>I have to execute two threads (runnable) in a specif order. In particular, I want that "first" is executed before "second". Here the code:</p>
  
  <pre><code>public static void main(String [] args) {
  
  
      MyFirstThread first = new MyFirstThread();
      MySecondThread second = new MySecondThread();
  
      new Thread(first).start();
      new Thread(second).start();
  
  }
  </code></pre>
  
  <p>How do I fix my code in order to ensure that first will be executed before second? Thanks</p>