What will happen when you compile the following code?
class SubEx extends Exception {}
interface Base
{
void method() throws Exception;
}
public class X implements Base
{
public void method() throws SubEx {};
}
A) Compilation error: "The access modifier for is made more restrictive"
B) Compilation error: "Cannot override method 'method'. It must have the same exception type."
C) Compilation error: "Interface methods can't be declared package."
D) Compilation error: "class SubEx must be defined in a file called 'SubEx.java'"
E) Compiles without any error.