首页 试题广场 > 试题详情
单选题

给定以下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 Method");? ? ? ? } finally{? ? ? ? ? ? System.out.printf("finally");? ? ? ? }? ? }? ? public static void main(String [] args)? ? {? ? ? ? try? ? ? ? {? ? ? ? ? ? aMethod(0);? ? ? ? }? ? ? ? catch (Exception ex)? ? ? ? {? ? ? ? ? ? System.out.printf("exception in main");? ? ? ? }? ? ? ? System.out.printf("finished");? ? }}

  • A.exception in main finished
  • B.finally finished
  • C.exception in main finally
  • D.finally exception in main finished
提交并查看答案
下一题 上一题
Ke星伙伴们的回答/ 6个回答
关闭
关闭

了解
畅学卡

手机端
学习