示例
public
static
class
ClassA
throws
NullPointerException {
public
void
methodA {
throw new
NullPointerException();
}
解决方案
为 throws 子句中声明的每个异常创建专门的 catch 子句。
public
static
class
ClassA
throws
Error {
public
void
methodA {
throw new
Error();
}