JAVA学习笔记(八)异常

来源:互联网 发布:医疗软件代理 编辑:程序博客网 时间:2024/06/04 20:06
public class ExceptionTest {/** * @param args */public static void main(String[] args) {// TODO Auto-generated method stubEtest a = new Etest();try {System.out.println("begin");a.test();System.out.println("end");}catch(Exception e) {System.out.println("Exception");}}}class Etest {public void test() throws Exception {throw new IllegalAccessException();}}

运行结果:

begin
Exception

 

原创粉丝点击