题库 软件开发 题目列表 给定以下JAVA代码,这段代码编译运行后输出的结果是(...
单选题
给定以下JAVA代码,这段代码编译运行后输出的结果是(   )。
public class Test {
 public static int aMethod(int i) throws Exception {
 try{
 return i/10;
 }catch(Exception ex){
 throw new Exception ("exception in a aMothod");
 }finally{
 System.out.print("finally");
 }
 }
 public static void main(String [] args) {
 try{
 aMethod(0);
 }catch(Exception ex){
 System.out.print("exception in main");
 }
 System.out.print("finished");
 }
 }
A.

finallyexception in mainfinished

B.

finallyfinished

C.

exception in mainfinally

D.

finallyexception in mainfinished

题目信息
校招真题
-
正确率
0
评论
9
点击