声明(未经检查的异常)沿着方法签名 b/c 抛出异常的好处是什么,它不会强制调用者保持在 try catch 块中。
public void testRuntimeEx()throws RuntimeException{
if(1==1){throw new RuntimeException()}
}
//Caller method
public void testCaller(){
// not necessery to handle even caller does not known which RuntimeException might be throws then what is the benefit throws clause with method signature
testRuntimeEx();
}