1
Reply

Which Catch block execute when we have multiple catch with try clause

Manav Pandya

Manav Pandya

6y
180
0
Reply

    IF you have catch blocks for specific types and that type of exception occurs, it will execute. Example catch(NullReferenceException e)() so if null reference exception occurs it will go here. ---------------------------------------------------------------------------------------------- Also ordering is very important in multiple catch blocks.Put specific catch blocks first then generic.For example catch(Exception e) will catch all type of exceptions, so put it last.