If all code is written in a try block and write a catch
block with Exception type Exception .In that scenario will
all the exceptions catched by that catch block? or any
exceptions which will not be caught?
Answer Posted / pompana gouda
Yes and No is the answer...
Yes because, Any type of exception will be caught by general
catch block.
No because,
If there are 3 lines which generate 3 different exceptions,
Then only first exception is caught in the general exception
catch block. If first line is not throwing exception then
whatever the line which throws exception will be caught...
Not all exceptions are handled by single catch statement.
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
Why do we use dictionary in c#?
What is namespace c#?
What does void mean in c#?
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; } }
What is the difference between namespace and class?
What is the meaning of extention?
How is exception handling implemented in c#?
What is dictionary collection in c#?
how to implement a web service in .net
What is a console operator?
Is and as keyword in c# net?
What is private in c#?
What is delegates in c# and uses of delegates?
Write a C# program to find the Factorial of n
What are the access modifiers in c#?