O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 19. EXCEPTION HANDLING

You will learn about the following in this chapter:

  • What an exception is

  • How an uncaught exception abruptly terminates a program

  • How to use the try and catch blocks to catch and handle exceptions

  • How you can use the finally block to ensure a particular block of code is always executed

  • How multiple catch blocks allow you to catch and handle different exception types thrown from the same block of code

  • Nested try blocks

  • How to explicitly throw and rethrow an exception with the throw keyword

  • How to define your own exception types

The .NET execution engine generates an exception when a special condition arises during the runtime of a program. Special conditions are violations of the C# language rules and .NET execution environment. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required