Originally Posted by
Arati2512
ya...but why?
Because it is not necessary. If the base class is throwing exception, then derived class may or may not throw. And I am calling derived class's method on object.
I'm not sure what is your exact question. As you said
derived class may or may not throw. Therefore because of the *may throw*,
main should declare or catch the exception. If you are asking why an
exception, must be caught or declared to be thrown I'm not the appropriate to tell you why is this a java requirement, but
here is an interesting link.