What's the reason behind this counter-intuitive Java "feature"?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4185340/java-try-finally-return-design-question">Java try-finally return design question</a>  </p>
</blockquote>



<p>Consider the following method:</p>

<pre><code>public boolean test() {
   try {
      return false;
   } finally {
      return true;
   }
}
</code></pre>

<p>Why does it return <code>true</code>? I know that the finally part is executed always, but should it first execute the try part and the return true and exit the method? Can someone explain me in simple words why Java exactly acts like this? I think it is very counter-intuitive.</p>
