I think I have to get my basics right with Exceptions. Please help and correct if I am not right.
If a riskymethod() throws a CheckedException, duckingmethod() calls the riskymethod() and does not "handle&declare" the exception, ---compile time error occures(JVM says unreported exception...)
If a riskymethod() throws a uncheckedException, duckingmethod() calls the riskymethod(() and does not "handle&declare" the exception thrown by the riskymethod() --- compiles fine---but run time error occurs
If a riskymethod() throws an Error, duckingmethod() passes the Error to the main() and does not "handle&declare" the Error thrown by the riskymethod() - compiles fine --but runtime error occurs
OK you already ducked that exception in the riskyMethod so you need not to catch that exception in the riskyMethod since you are ducking that exception, in the handling method you should put the calling code inside try/catch which you did already or declare the handling method itself to duck that exception using throws clause.
If you do this then you have to put the calling code in the main method inside try/catch or declare main itself to duck that exception in which case JVM will handle that exception and terminate the program.
So if you are ducking an exception it will fall through the calling stack until it is either handle by trt/catch block or by JVM itself.
one more thing and of course an important point related to it.
polymorphism works for the overridden method but it is resolved at runtime.
so in case when the superclass method declares a checked exception and the overridden method in subclass doesn't declare it
if we polymorphically call the subclass method using superclass reference , despite the method in subclass will be called we will have to handle or declare it to
get the code compiled sucessfully