title: Finally always executed before method is finished?
body: <p>I stepped upon a case where I want to write my code like this:</p>
  
  <pre><code>try {  
      something();  
      return success;  
  }  
  catch (Exception e) {   
      return failure;  
  }  
  finally {  
      System.out.println("i don't know if this will get printed out.");
  }
  </code></pre>
  
  <p>(from <a href="https://stackoverflow.com/questions/65035/does-finally-always-execute-in-java">Does finally always execute in Java?</a>)</p>
  
  <p>My question is:</p>
  
  <p>Is <code>finally</code> always executed before the method is finished or does it run in an extra <code>thread</code> (because the method is already finished with the object's return)?</p>
  
  <p>In other words: Is it guaranteed that finally is executed before main method is continued?</p>