Chapter Summary

The .NET Framework provides fully integrated support for exception handling. In fact, it allows you to raise exceptions in one language and catch them in a program written in another language. The try block is used to enclose code that might cause exceptions. The catch block is used to handle the exceptions raised by the code in the try block, and the finally block ensures that certain code is executed, regardless of whether an exception occurs.

KEY TERMS

The FCL provides a large number of exception classes that represent most of the exceptions that a program may encounter. If you prefer to create your own custom exception class, you can do so by deriving your exception class from the ...

Get MCAD/MCSD.NET Training Guide (Exam 70-316): Developing and Implementing Windows®-Based Applications with Microsoft® Visual C#™ .NET and Microsoft® Visual Studio® .NET 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.