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 |
If we inherit a class do the private variables also get inherited ?
Where do we set the min and max pool size for connection pooling?
Is c sharp open source?
What is private virtual in C#?
How long does a loop recorder procedure take?
What is InterFace???
Please write a program to display “welcome to bestinterviewquestion.com” in c#?
Can a structure inherit a class.
Explain the functionalities of satellite assembly?
Which of the following API is used to hide a window?
Which string method is used for concatenation of two strings in c#?
What is integer c#?