[Solved] Exception in overriding methods [duplicate]


Overridden methods cannot throw newer or broader checked exception just because, when the object of this class is referred polymorphic-ally, the caller can handle only exceptions shown in the contract by the base class method implementation.

Overridden method can throw unchecked exception in case if parent method throws it or not. You can even not declare it in signature.
But if parent method throws checked exception you can only specialize this exception in the child (throw same exception, it’s descendants or none).

Refer this link for better understanding : http://www.javatpoint.com/exception-handling-with-method-overriding

solved Exception in overriding methods [duplicate]