Summary

Exceptions are errors or abnormal situations that arise during program execution. C# supports many standard exception classes. All exception classes must be derived from the System.Exception class.

The throw statement throws exceptions. The other exception handling statements are the try, catch, and finally statements.

The checked and unchecked keywords perform overflow evaluations on constant and non-constant expressions in checked and unchecked contexts.

C# also supports user-defined exception classes apart from the system-defined exception classes.

Get Special Edition Using C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.