重複の可能性:
Javaでは、最終的にトランプを返しますか?
以下の例では、
class ex8
{
public void show()
{
try
{
int a=10/0;
return;
}
catch(ArithmeticException e)
{
System.out.println(e);
return;
}
finally
{
System.out.println("Finally");
}
}
public static void main(String[] args)
{
new ex8().show();
}
}
出力は次のとおりです。
java.lang.ArithmeticException: / by zero
Finally
catchのreturnステートメントにもかかわらずFinallyが出力されるのはどうしてですか?