February 2017
Beginner
1056 pages
28h 57m
English
I’ll make an exception this time.
—MY MOTHER
You can define your own exception classes, but they must be derived classes of some already defined exception class. An exception class can be a derived class of any predefined exception class or of any exception class that you have already successfully defined. Our examples will be derived classes of the class Exception.
When defining an exception class, the constructors are the most important and often the only methods, other than those inherited from the base class. For example, Listing 9.5 contains an exception class, called DivideByZeroException, whose only methods are a default ...
Read now
Unlock full access