3 ms·
I was about to post something similar to this. In java you need to specify what your function can throw and if it tries to throw something that it has not spec
by X-Istence 8y ago
I was about to post something similar to this.
In java you need to specify what your function can throw and if it tries to throw something that it has not specified as being able to throw, then your program won't compile.
- StavrosK 8y agoThat's an acceptable solution as well.
- weberc2 8y agoAgreed, checked exceptions solve the same problem, but having separate control flow mechanism for certain kinds of data still seems subpar. Return values can solve the same problems and are more general.
- AstralStorm 8y agoNot if you cannot enforce them to be checked.