Java : Why exception is not being caught inside the Second Method catch block
<p>I have this method calling the below method , i am purposufully providing a wrong port number for the URL to be connected .
But to my surprise , the exception  produced is   being  caught  in  first Method  catch block
Why it is not being handled inside the executeData Method's catch block ??</p>

<pre><code>**1st Method** 
public APIResponse execute(Request request, Class&lt;? extends Response&gt; responseClass) {
        try {
        String xmlResponse = executeData(request);
                  // some code
        return response;
        }
        catch (Exception ex) {

            return new Response(ErrorCode.SYSTEM_ERROR);
        }
    }

2nd Method
public String executeData(Request request) throws IOException {
        URL url = null;
        URLConnection urlc = null;
        try {
            url = new URL("http://localhost:80870/");
            urlc = url.openConnection();

        }
        catch (Exception ex) {
        ex.printStackTrace();
**// This is not being executed .**
        }

                           // Some code
                   // Some code
        return xmlResponse;
    }
</code></pre>
