Given:
static class A {
void process() throws Exception { throw new Exception(); }
}
static class B extends A {
void process() { System.out.println(“B”); }
}
public static void main(String[] args) {
new B().process();
}
What is the result?
A.
B
B.
The code runs with no output.
C.
Compilation fails because of an error in line 12.
D.
Compilation fails because of an error in line 15.
E.
Compilation fails because of an error in line 18.
Explanation: