Java compiler insists that all exceptions thrown by the new method must be
the same as, or subclasses of, the exception classes thrown by the original method.
import java.io.EOFException;
import java.io.IOException;
import java.net.MalformedURLException;
class BaseClass {
publicvoid method() throws IOException {
}
}
class SubOne extends BaseClass {
publicvoid method() throws IOException {
}
}
class SubTwo extends BaseClass {
publicvoid method() {
}
}
class SubThree extends BaseClass {
publicvoid method() throws EOFException, MalformedURLException {
}
}