What is the use of throw and throw exception in .Net?

 Posted by Kmandapalli on 2/5/2014 | Category: ASP.NET Interview questions | Views: 2064 | Points: 40

When we use "throw" statement, it preserves or gives us the original stack trace.
When we use "throw ex" statement, stack trace of the exception will be replaced with the stack trace starting at the re-throw point.
So, it is very important to use throw statement instead of throw ex statement as it gives more accurate stack trace.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response