与えられた
public class ToBeTestHandleException{
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) {
A a = new B();
a.process();
}
}
(a.process()) 行で例外を処理する必要があるのはなぜですか?.クラス B のメソッド process は例外をまったくスローしません。PS:これは SCJP の質問です。