In C#, the exception-handling mechanism allows only objects of class Exception (namespace
System) and its derived classes to be thrown and caught. Note, however, that C# programs may interact with software components written in other .NET languages (such as C++) that do not restrict exception types. The general
catch clause can be used to catch such exceptions.
This section overviews several of the .NET Framework’s exception classes and focuses exclusively on exceptions that derive from class
Exception. In addition, we discuss how to determine whether a particular method throws exceptions.
System) is the base class of .NET’s exception class hierarchy. An ...