Java / Exception
Explain exception handling when overriding a method?
Overriding method cannot throw higher Exception than the overridden method. If the original method throws IOException then the overriding method cannot throw superclass of IOException, I.e., Exception but it can throw any subclass of IOException or does not throw any Exception at all.
This rule only applies to only checked Exception, overridden method is free to throw any unchecked Exception.
More Related questions...