题目内容
(请给出正确答案)
[主观题]
【分录题】(9-3)参照下面的异常类之间的关系图,阅读程序,写出程序运行结果。(注意输出语句不换行)
public class Demo7 { static int x=12; static void createException() { throw new ArrayIndexOutOfBoundsException(); } static void show() { try { createException(); x++; }catch(ArithmeticException e) { x++; }finally { x++; } x++; } public static void main(String[] args) { try { show(); }catch(Exception e) { System.out.print(x); } System.out.println(x); } }
提问人:网友eyrain
发布时间:2022-01-07