Gautam Kumar
Can multiple catch blocks be executed?
By Gautam Kumar in C# on Nov 19 2013
  • Ranjit Powar
    Apr, 2014 22

    Never when one catch block is executed, controls skip all other catch blocks and goes to finally block.

    • 1
  • Gautam Kumar
    Nov, 2013 19

    No, Multiple catch blocks can't be executed. Once the proper catch code executed, the control is transferred to the finally block and then the code that follows the finally block gets executed.

    • 1
  • ramila raj
    Nov, 2019 8

    No ITs not possible can you please check this link for brief explanation

    https://youtu.be/sdjR0D5nyqQ

    • 0
  • ramila raj
    Nov, 2019 8

    Yes its possible..can you please check this url (it has an example for it)

    https://youtu.be/sdjR0D5nyqQ

    • 0
  • Ananth G
    Oct, 2016 21

    yes multiple catch is possible in c#

    • 0
  • Sachin Kumar
    Nov, 2015 20

    No.Catch block that handles the exception will get executed and all other catch will be skipped and then control goes to finally block if there is any and then to subsequent code after the finally block. class A {static void Main(string[] args){try{int a = 10;int b = 0;int i = a / b;}catch (DivideByZeroException){Console.WriteLine("Inside Specialized Catch");}catch (Exception){Console.WriteLine("Inside Generalized Catch");}finally{Console.WriteLine("Inside Finally");}Console.WriteLine("Outside try/catch/finally --- I got chance to Run");} }

    • 0
  • suraj ghosi
    Sep, 2015 25

    yes we have multiple catch block . just type in google "can we have multiple catch for a single try in c# " you found out your answer

    • 0
  • Pramod Verma
    Jan, 2015 27

    No

    • 0
  • Ranjit Powar
    Apr, 2014 22

    Never when one catch block is executed, controls skip all other catch blocks and goes to finally block.

    • 0
  • Ranjit Powar
    Apr, 2014 22

    Never when one catch block is executed, controls skip all other catch blocks and goes to finally block.

    • 0
  • Ranjit Powar
    Apr, 2014 22

    Never when one catch block is executed, controls skip all other catch blocks and goes to finally block.

    • 0
  • Ranjit Powar
    Apr, 2014 22

    Never when one catch block is executed, controls skip all other catch blocks and goes to finally block.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS