Checked exception
From APIDesign
(Difference between revisions)
Line 1: | Line 1: | ||
[[wikipedia::Checked_exception|Checked exceptions]] are [[Java]] invention and many like to argue that they are the worst invention ever. I like [[APIDesignPatterns:Exceptions|exception]]s and I like [[Checked exception]]s. One day I'll explain why. | [[wikipedia::Checked_exception|Checked exceptions]] are [[Java]] invention and many like to argue that they are the worst invention ever. I like [[APIDesignPatterns:Exceptions|exception]]s and I like [[Checked exception]]s. One day I'll explain why. | ||
+ | |||
+ | There is a really nice thing on [[checked exception]]s: if a method declares that it throws a [[checked exception]], the caller of the method has to handle it. This is really nice language feature, if used at the appropriate place. What is such appropriate place? If one reads a file... | ||
[[TBD]] | [[TBD]] |
Revision as of 14:10, 1 April 2016
Checked exceptions are Java invention and many like to argue that they are the worst invention ever. I like exceptions and I like Checked exceptions. One day I'll explain why.
There is a really nice thing on checked exceptions: if a method declares that it throws a checked exception, the caller of the method has to handle it. This is really nice language feature, if used at the appropriate place. What is such appropriate place? If one reads a file...