C# try/catchIn C# programming, exception handling is performed by try/catch statement. The try block in C# is used to place the code that may throw exception. The catch block is used to handled the exception. The catch block must be preceded by try block. C# example without try/catchOutput: Unhandled Exception: System.DivideByZeroException: Attempted to divide by zero. C# try/catch exampleOutput: System.DivideByZeroException: Attempted to divide by zero. Rest of the code
Next TopicC# finally
|