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 |
How can I process command-line arguments?
What is the use of console application in c#?
What is orm in c#?
How can I create image pieces/sub image?
Define multicast delegate in c#?
Distinguish between a class and struct?
What is architecture of your poroject? how i c an say?
2 Answers Eminosoft, HCL, Phoenix Technologies,
Wht executescaler method is used?
What does assemblyinfo.cs consists ?
What is c# entity framework?
What is the and operator in c#?
how to communicate inventory system and account system?