try { // throws IOException } catch(Exception e) { } catch(IOException e) { }
when try block throws IOException, it wi
try
IOException
The reason is that IOException derives from Exception, so IOException actually is an Exception ("is-a") and therefore the first catch handler matches and is being entered.
Exception
catch