题型:单选题 标签:代码
题目:
12. 有如下代码:
public class Test
{
public static int testException(int i)throws Exception
{
try
{
return i/5;
}
catch(Exception e)
{
throw new Exception("exception in a aMethod");
}
finally{
System.out.pfintf("finally");
}
}
public static void main(String[] args)
{
try
{
testException(0);
}
catch(Exception ex)
{
System.out.printf("exception in main");
}
System.out.printf("finished");
}
}
以上这段代码编译运行后,输出的结果是______。
A.finallyexception in mainfinished
B.finallyfinished
C.exception in mainfinally
D.finallyexception in mainfinished