title: Join Threads java
body: <p>I have this code:</p>
  
  <pre><code>public final class Hello() {
  
      static long x1;
      static long x2;
  
      public static long start(args...) {
         //commands...
         Thread left = new Thread(){ 
             @Override
             public void run(){ 
                 x1 = amethod(args...);   
             }
         }; 
         Thread right = new Thread(){ 
             @Override
             public void run(){ 
                 x2 = amethod(args...);  
             }
         }; 
         left.start(); 
         right.start();
         x = x1 + x2;
     }
     return x;
  }
  </code></pre>
  
  <p>Thread named <code>"left"</code> and thread named <code>"right"</code> are independent threads. My question is if x gets the correct value or the command <code>"x=x1+x2"</code> will executed before the threads ends.</p>
  
  <p>I must use compulsorily <code>join()</code>?</p>