. Similarly, the
must appear last. To prove this point for yourself, try rearranging the
catch
clauses. Doing
clause is to catch an entire category of exceptions. For
example, imagine you are creating a set of exceptions for some device. If you derive all of
the exceptions from a common base class, then applications that don’t need to know precisely
what problem occurred could simply catch the base class exception, avoiding the unnecessary
duplication of code.
360
P a r t I :
T h e C # L a n g u a g e
Do'stlaringiz bilan baham: