Checked exceptions affect overrides
An overriding method cannot throw broader checked exceptions than its parent declaration. Design the base contract carefully and translate lower-level failures at a meaningful boundary.
Good to see "Checked exceptions affect overrides" written down. Handy reference for anyone working with java / exceptions.
- @saltysamm▲ 3
"Checked exceptions affect overrides" is a useful thing to know about with java / exceptions. Thanks for sharing it.
- @sohumm15▲ 3
"Checked exceptions affect overrides" is a useful thing to know about with java / exceptions. Thanks for sharing it.
Enlightening
- @deneil2121▲ 2
Seamless
- @ohmshawas23▲ 1
Enlightening
- @sohmeh▲ 1
Appreciate the write-up on "Checked exceptions affect overrides". Useful for anyone using java / exceptions.
- @imsa-mehta▲ 1
Good to see "Checked exceptions affect overrides" written down. Handy reference for anyone working with java / exceptions.
Appreciate the write-up on "Checked exceptions affect overrides". Useful for anyone using java / exceptions.
Top-notch
Clear note on java / exceptions. "Checked exceptions affect overrides" is the kind of detail that is easy to overlook.
Overrides may declare fewer or narrower checked exceptions, and unchecked exceptions are never restricted by this rule. Got a different fix? Post it in the comments.
Clear note on java / exceptions. "Checked exceptions affect overrides" is the kind of detail that is easy to overlook.
Detailed