Exceptions are not an object-oriented feature themselves. We discuss them briefly nevertheless, because they heavily influence the style of collaboration 1.5.7 between objects. Independently of whether we choose to declare them explicitly in methods’ interfaces or use unchecked exceptions throughout, callers must be aware of possible exceptions and must be prepared to react correspondingly. At the same time, robustness and proper error handling are major requirements for professional code.
1.5.1 Basic Usage
Java’s exception mechanism is really straightforward:
throw stops normal execution; code in the block is skipped, methods ...