O'Reilly logo

C# 2010 for Programmers, Fourth Edition by Harvey M. Deitel, Paul J. Deitel

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

13. Exception Handling

Objectives

In this chapter you’ll learn:

• What exceptions are and how they’re handled.

• When to use exception handling.

• To use try blocks to delimit code in which exceptions might occur.

• To throw exceptions to indicate a problem.

• To use catch blocks to specify exception handlers.

• To use the finally block to release resources.

• The .NET exception class hierarchy.

Exception properties.

• To create user-defined exceptions.

It is common sense to take a method and try it. If it fails, admit it frankly and try another. But above all, try something.

Franklin Delano Roosevelt

O! throw away the worser part of it, And live the purer with the other half.

William Shakespeare

If they’re running and they don’t look ...

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