(未チェック例外)を宣言する利点は、メソッドシグニチャb/cに沿って例外をスローすると、呼び出し元がtry catchブロックに保持されないことになります。Java RuntimeExceptionを投げることの利点
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();
}
これはチェックされていないため、宣言する必要はありません。 – edwardw