if a method in a superclass does NOT throw an exception, and if the subclass overrides the method, can the latter throw an exception ?
posted 13 years ago
No. Suppose class A has method m() which throws exceptions X, Y and Z. Suppose class B extends A and overrides m(). Then m() of B can only throw: 1. X, Y, Z (some or all) 2. subclasses of X, Y, Z (some or all) 3. none at all but m() cannot throw exceptions W or U.