Can multiple catch blocks be executed?

Answers were Sorted based on User's Feedback



Can multiple catch blocks be executed?..

Answer / senthil kumar

No.We may have the multiple catch block.Every catch block
has the different exception.when code found any error
suitable exception will be fired.but only one catch block
executed.

Is This Answer Correct ?    20 Yes 1 No

Can multiple catch blocks be executed?..

Answer / daniel

No, once the proper catch code fires off, the control is
transferred to the finally block (if there are any), and
then whatever follows the finally block.

Is This Answer Correct ?    16 Yes 3 No

Can multiple catch blocks be executed?..

Answer / kumarraju

Not Executed Multiple catch blocks, exception raised then
corresponding catch block only executed, after that finally
block executed. In case Exception is not raised then
finally block executed.

why you are writing multiple catch blocks than
one catch blocks?
Ans: you does not know what the exception raise, then you
are excepting some exceptions thats only you write multiple
catch blocks.

Is This Answer Correct ?    6 Yes 1 No

Can multiple catch blocks be executed?..

Answer / guest

It is possible to use more than one specific catch clause
in the same try-catch statement. In this case, the order of
the catch clauses is important because the catch clauses
are examined in order. Catch the more specific exceptions
before the less specific ones.

source: msdn

Is This Answer Correct ?    3 Yes 6 No

Post New Answer

More C Sharp Interview Questions

what will be the output of the given below coding. using System; public class Exercise { static void OddNumbers(int a) { if (a >= 1) { Console.Write("{0}, ", a); a -= 2; OddNumbers(a); } } public static int Main() { const int Number = 9; Console.WriteLine("Odd Numbers"); OddNumbers(Number); Console.WriteLine(); return 0; } }

1 Answers   iGate,


How u make an application remotable?

1 Answers  


what are the Disadvantages of vb

0 Answers   Digital GlobalSoft,


Why do we use 0?

0 Answers  


Should I use double or float?

0 Answers  


What is difference between continue and break in c#?

0 Answers  


What is Delegate and what is it used for ?

0 Answers   NA,


What does assert() do in c#?

0 Answers  


What's the difference between an integer and int?

0 Answers  


While debugging a C# application can you change the value of a variable?

0 Answers   Siebel,


What do you mean by sealed classes and static classes?

0 Answers   Accenture,


Why we use get and set method in c#?

0 Answers  


Categories