复制代码
- static void test() throws Error {
- if (true) throw new AssertionError();
- System.out.print(“test “)
- }
- public static void main(String[] args) {
- try { test(); }
- catch (Exception ex) { System.out.print(“exception “);
- System.out.print(“end”)
- }
test方法声明抛出Error, 那抛出的AssertionError异常, 在主函数Exception应该捉不都的吧。???
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |