1.

What are the Built-in Exceptions in C#?

Answer»

Exceptions in C# are REPRESENTED by classes. The System.Exception class has all the classes to handle exceptions.

Let us see some of the classes under the System.Exception class:

  • System.IO.IOException: Handles I/O errors.
  • System.IndexOutOfRangeException: Handles errors generated when a method refers to an array index out of range.
  • System.ArrayTypeMismatchException: Handles errors generated when TYPE is mismatched with the array type.
  • System.NullReferenceException: Handles errors generated from referencing a null object.
  • System.DivideByZeroException: Handles errors generated from DIVIDING a dividend with zero.
  • System.InvalidCastException: Handles errors generated during typecasting.
  • System.OutOfMemoryException: Handles errors generated from insufficient free MEMORY.


Discussion

No Comment Found