What is the base class for all exceptions in C#?


The System.SystemException class is the base class for all predefined system exception. Some of the exception classes derived from the System.Exception class are the System.ApplicationException and System.SystemException classes.

The System.ApplicationException class supports exceptions generated by application programs. Hence the exceptions defined by the programmers should derive from this class.

The following are the exceptions under the base class System.SystemException −

Sr.No.Exception Class & Description
1System.IO.IOException
Handles I/O errors.
2System.IndexOutOfRangeException
Handles errors generated when a method refers to an array index out of range.
3System.ArrayTypeMismatchException
Handles errors generated when type is mismatched with the array type.
4System.NullReferenceException
Handles errors generated from referencing a null object.
5System.DivideByZeroException
Handles errors generated from dividing a dividend with zero.
6System.InvalidCastException
Handles errors generated during typecasting.
7System.OutOfMemoryException
Handles errors generated from insufficient free memory.
8System.StackOverflowException
Handles errors generated from stack overflow.

Updated on: 20-Jun-2020

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements