标签:
class OwnException extends Exception { public OwnException(String msg) { super(msg); System.out.println("hello myexception"); } } class OwnExceptionSource { public void a() throws OwnException{ throw new OwnException(null); } } public class OwnExceptionHandler1{ public static void main(String[] args) { OwnExceptionSource r = new OwnExceptionSource(); try{ r.a(); //System.out.println("in try block"); }catch(Exception e) { //System.out.println("in catch block"); e.printStackTrace(); }finally{ System.out.println("the last"); } //System.out.println("after exception"); } }
标签:
原文地址:http://www.cnblogs.com/xuhuaiqu/p/4466961.html