can we throw execption from catchblock

Answers were Sorted based on User's Feedback



can we throw execption from catchblock..

Answer / praseetha sandeep

yes, we can throw...
catch(Exception e)
{
....
thow e
}

you can also throw new exceptin of different type
catch(IOException c)
{....
throw new FileNotFoundexception(filename)
}

we can also do like
catch(IOException c)
{
throw new FileNotFoundexception(filename,c)
}

Is This Answer Correct ?    6 Yes 0 No

can we throw execption from catchblock..

Answer / suman dey

yes we can use 'throw' or new Exception.

Is This Answer Correct ?    4 Yes 0 No

can we throw execption from catchblock..

Answer / nithya

We can throw exception in catch block

Like

try
{
int a=10/0;
}
catch(Exception ex)
{
throw ex;
}

Is This Answer Correct ?    4 Yes 0 No

can we throw execption from catchblock..

Answer / ganni

the 'try' block contains the code which may have the
runtime errors. to handle that errors we use 'catch' block.

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More C Sharp Interview Questions

What is console application with example?

0 Answers  


C# is case sensitive, what is mean by case sensitive

3 Answers  


What is COM Interoperability?

0 Answers   DELL,


What is disconnected data architecture in c#?

0 Answers  


In which situation(s), the use of "Delegate" is a good idea?

0 Answers   MCN Solutions,






What can you do as a .net developer?

0 Answers  


What?s class SortedList underneath?

1 Answers  


What's c# ?

0 Answers  


What is the difference between string and string in c#?

0 Answers  


What is xaml file in c#?

0 Answers  


Does c# replace c++?

0 Answers  


Tell me something about Exceptions. What is the common exception class?

4 Answers   HCL,


Categories