Why is catching checked exceptions allowed for code that does not throw exceptions?
Quoting the Java Language Specification, ยง11.2.3: It is a compile-time error if a catch clause can catch checked exception class E1 and it is not the case that the try block corresponding to the catch clause can throw a checked exception class that is a subclass or superclass of E1, unless E1 is Exception or … Read more