![](https://csdnimg.cn/release/download_crawler_static/10117520/bg10.jpg)
CONTENTS
xiv
Overriding System.Object.ToString() .................................................................................................... 247
Overriding System.Object.Equals() ....................................................................................................... 247
Overriding System.Object.GetHashCode() ............................................................................................ 248
Testing Your Modified Person Class ..................................................................................................... 249
The Static Members of System.Object ................................................................................................. 250
Summary .......................................................................................................................250
Chapter 7: Understanding Structured Exception Handling .................................253
Ode to Errors, Bugs, and Exceptions .............................................................................253
The Role of .NET Exception Handling.............................................................................254
The Building Blocks of .NET Exception Handling.................................................................................. 255
The System.Exception Base Class........................................................................................................ 255
The Simplest Possible Example.....................................................................................257
Throwing a General Exception.............................................................................................................. 259
Catching Exceptions ............................................................................................................................. 260
Configuring the State of an Exception ...........................................................................261
The TargetSite Property........................................................................................................................ 261
The StackTrace Property ...................................................................................................................... 262
The HelpLink Property .......................................................................................................................... 263
The Data Property................................................................................................................................. 264
System-Level Exceptions (System.SystemException) ...................................................266
Application-Level Exceptions (System.ApplicationException) .......................................266
Building Custom Exceptions, Take One ................................................................................................ 267
Building Custom Exceptions, Take Two................................................................................................ 269
Building Custom Exceptions, Take Three ............................................................................................. 269
Processing Multiple Exceptions.....................................................................................271
General catch Statements .................................................................................................................... 274
Rethrowing Exceptions......................................................................................................................... 274