Handling Exceptions
Introduction
This lesson covers the fourth objective of the Oracle Certified Professional Java SE 21 Developer exam (1Z0-830): Handling Exceptions. Oracle does not publish a weighting per objective, but exception handling is a rich source of "does it compile?" and "what is printed?" questions because the rules are precise: which exceptions must be declared, which catch orders are legal, what finally does to a returned value, and how try-with-resources closes and suppresses.
You will learn the exception hierarchy, the full try/catch/finally semantics, multi-catch, try-with-resources with suppressed exceptions, the overriding rules for throws, and how to design custom exceptions. Every section ends with the traps the exam uses.
