O'Reilly logo

Microsoft® Visual C#® 2005 Step by Step by John Sharp

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 6. Managing Errors and Exceptions

After completing this chapter, you will be able to:

  • Handle exceptions by using the try, catch, and finally statements.

  • Control integer overflow by using the checked and unchecked keywords.

  • Raise exceptions from your own methods by using the throw keyword.

  • Ensure that code always runs, even after an exception has occurred, by using a finally block.

You have now seen the core C# statements you need to know to read and write methods; declare variables; use operators to create values; write if and switch statements to selectively run code; and write while, for, and do statements to repeatedly run code. However, the previous chapters haven’t considered the possibility (or probability) that things can go wrong. It ...

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