Can we throw exception from catch block
Answers were Sorted based on User's Feedback
Answer / chandan kumar
yes, we can throw exception from catch block
Is This Answer Correct ? | 17 Yes | 2 No |
Answer / chandan kumar
yes we can, i have tried it.it is working fine
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / sudipta
Throw statement can be used in the catch block to rethrow
the exception,which has been caught by the catch statement.
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / brijen.patel
Yes, we can throw exception from catch block.
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / prosanta
yes,
follow this example-
static void Main(string[] args)
{
try
{
throw new Exception();
}
catch
{
try
{
Console.WriteLine("This is the 1st
exception");
throw new Exception();
}
catch
{
Console.WriteLine("This is the 2nd
exception");
Console.Read();
}
}
}
output:
This is the 1st exception
This is the 2nd exception
Is This Answer Correct ? | 5 Yes | 2 No |
Are c# constructors the same as c++ constructors?
who is a protected class-level variable available to?
Which of the following operations can you not perform on an ado.net dataset?
How long can loop recorders stay in?
What is the usage of OLE?
What are the ways to deploy an assembly?
What is meant by collections in c#?
What is a shared assembly?
What is eager loading in c#?
Where is c# compiler located?
Can enum have methods c#?
Are classes passed by reference in c#?