can we throw execption from catchblock

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are there constructors in c sharp?

571


What is the implicit name of the parameter that gets passed into the set method/property of a class?

499


How many static constructors are allowed in a class?

482


Any problem found in vs.et

586


Can fields inside a class be virtual?

541






How long does it take to learn c# for unity?

487


Is it possible to force garbage collector to run?

480


Does the system.exception class have any cool features?

507


Are constructors inherited c#?

513


Illustrate namespaces in c#?

550


What's the difference between a static method and a non static method c#?

503


What is the difference between convert and parse in c#?

450


Why delegates are safe in c#?

455


what is generics? can u explain 5 to 6 examples on generics that covers class,method,structure,list,delegates?

1448


What is concrete method in c#?

492