Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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 are the different states of a thread?

0 Answers  


What is the difference between ienumerable and enumerable?

0 Answers  


When should I throw an exception?

0 Answers  


Can you inherit multiple interfaces?

7 Answers   Host4Big, Mind Tree, Moftak Solutions, Siebel Systems,


Do void methods have parameters?

0 Answers  






how to use caching in our program. why we use it give one example in code

1 Answers  


Explain about CTS?

0 Answers   Microsoft,


Explain what is an interface in c#?

0 Answers  


Can u create multiple threads of execution ?

1 Answers   IBM, ITC Infotech, UHU,


What do you mean by saying a "struct is a value type"?

0 Answers  


What is parameterized constructor?

0 Answers  


How is exception handling implemented in c#?

0 Answers  






Categories