範例

public static class ClassA throws RuntimeException {
public void methodA {
//...

throw new RuntimeException();
}
}

解決方案
針對 throws 子句中所宣告的每個 Runtime 異常狀況,各建立一個專用的 catch 子句。