C Sharp (C#) - Exception Handling
What is the main difference between
throw; and throw ex; inside a catch block in C#?throw; and throw ex; inside a catch block in C#?throw; behaviorthrow; rethrows the caught exception without changing the stack trace, preserving where the exception originally occurred.throw ex; behaviorthrow ex; throws the exception object again but resets the stack trace to the current method, losing original error location.throw; preserves the original stack trace, throw ex; resets it. -> Option A15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions