Unreachable code- try-catch-finally
<p>I know if java finds a line of code where it's guaranteed that control will never reach, then compiler reports unreachable code error.<br>
consider following code.</p>

<pre><code>    static int method1() {

        try{ return 1; }
        catch(Exception e){ }  // LINE-1
        finally{ }
        System.out.println("abc");  //LINE-2
        return 2;
    }
}
</code></pre>

<p>in above code <br>
<strong>1</strong>  try block is guaranteed to exit by returning 1 but still lines after finally block (LINE-2 onwards) are reachable.<br>
<strong>2</strong>. if i comment catch block (LINE-1), LINE-2 becomes unreachable.<br><br>
Why is it so. Doesn't compiler able to see unconditional return in try block for case-1. </p>