は、サンプルコードを考えてみましょう:catchブロックでcatchオブジェクトを呼び出した後でも、例外オブジェクトを呼び出しメソッドにスローできますか?
public void someMethod() throws Exception{
try{
int x = 5/0; //say, or we can have any exception here
}
catch(Exception e){
if(counter >5){ // or any condition that depends on runtime inputs
//something here to throw to the calling method, to manage the Exception
}
else
System.out.println("Exception Handled here only");
}
}
したがって、この可能性のようなものはありますか? 「はい」の場合、「ここに何かを呼び出して例外を管理する何か」の代わりに何が出てくるのか...
I.E.私の質問は、このように条件付きで管理することができ、ここで例外を処理するかどうかです。
ちょうどそれを投げる? – user2357112
それを投げているだけではない –