Let's go over a few runtime-generated exceptions that .NET Framework supports. The framework uses these exceptions on valid statements that are being executed. Then, based on their type, an exception from the following table is thrown. For example, if the compiler tries to execute a division operation and if the denominator is zero, DividebyZeroException is thrown:
Exception |
Description |
ArithmeticException |
An exception that's triggered while performing arithmetic operations can be caught. |
ArrayTypeMismatchException |
When the value and type of the array don't match, this exception is thrown. |
DivideByZeroException |
When an attempt to divide an integer value by zero is made, this exception is thrown. |
IndexOutOfRangeException |
When an array is accessed with an index outside of its boundaries, this exception is... |