Exceptions and Object Lifetime

  • Andrew Troelsen


In the previous chapter, you dug into the details of how C# supports encapsulation services, reuse of code (inheritance), and polymorphic activity among related classes. The point of this chapter is twofold. First, you will come to understand how to handle runtime anomalies in your code base through the use of structured exception handling. Not only will you learn about the C# keywords that allow you to handle such problems (“try”, “catch”, “throw”, “finally”), but you will also come to understand the distinction between application-level and system-level exceptions. This discussion will also provide a lead-in to the topic of building custom exception types, as well as how to leverage the built-in exception handling functionality of Visual Studio .NET.


Base Class Garbage Collection Exception Handling Garbage Collector Object User 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Andrew Troelsen 2003

Authors and Affiliations

  • Andrew Troelsen

There are no affiliations available

Personalised recommendations