20 ms·
If you use try-with-resources in Java 7, you don't need to write any exception handling. The function would be '... throws IOException'. That seems to satisfy
by justinsb 12y ago
If you use try-with-resources in Java 7, you don't need to write any exception handling.
The function would be '... throws IOException'. That seems to satisfy the "think of disk/network failure as a very common case" design goal with minimal boilerplate. That brings up a separate discussion on checked vs unchecked exceptions, but I guess we can save that one for comparisons against a language with unchecked exceptions!