2 ms·
Your Ruby example is unnecessarily complicated. Why not just use File.read? Why are you distinguishing two different kinds of exceptions, but not in the case of
by xigoi 3y ago
Your Ruby example is unnecessarily complicated. Why not just use File.read? Why are you distinguishing two different kinds of exceptions, but not in the case of Java? And what if you don't need error handling?