Manav Pandya
Which Catch block execute when we have multiple catch with try clause
By Manav Pandya in C# on Jan 16 2018
  • Tushar Dikshit
    Jan, 2018 25

    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.

    • 0