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
What are the differences between events and delegates in c#?
How can it prevents DLL Hell assembly versioning in .NET?
What do you mean by expression tree?
What does firstordefault mean in c#?
What is use of list in c#?
Describe ado.net?
What is difference between an Structure and Class?
list the steps in code compilation in c#?
What is the difference between interface and abstract class in c#?
What is the difference between a function and a method?
What is a event in c#?
What is type keyword in c#?
Can int be null in c#?
Is stringbuilder better than string?
What is the difference between list and array in c#?