日期:2014-05-20 浏览次数:20867 次
package com.train.first; import java.io.IOException; public class Test { public static void main(String[] args) throws Exception { try { try { if (true) { throw new IOException("NEW EXCEPTION"); } } catch (IOException e) { throw new ChainedException(e); } } catch (ChainedException e) { e.printStackTrace(); } } } class ChainedException extends Exception { private static final long serialVersionUID = 1L; public ChainedException(Exception e) { super(e.getMessage(), e.getCause()); } }