Originally posted by J Sato:
Consider the following:
The first someMethod() does not throw any exceptions. The second someMethod() throws Exception which is the narrowest checked exception that can be thrown. The third someMethod() throws IOException and will not compile.
No Sato the method that throws IOException will not cause any error. Because IOException is all so a subclass of Exception. If u execute your code then an error may come because you did not import java.io.*; to use the IOException.
Ingeneral if the base class method throws an exception then the derived class method that overrides this method can either throw the same exception or subclass of the same exception or may not even throw an exception.