]]>閲嶆幏寮傚父鏃跺浣曟崟鑾瘋繖涓紓甯?http://m.tkk7.com/dance-elephant/archive/2008/07/15/215005.htmldance_elephantdance_elephantTue, 15 Jul 2008 08:35:00 GMThttp://m.tkk7.com/dance-elephant/archive/2008/07/15/215005.htmlhttp://m.tkk7.com/dance-elephant/comments/215005.htmlhttp://m.tkk7.com/dance-elephant/archive/2008/07/15/215005.html#Feedback1http://m.tkk7.com/dance-elephant/comments/commentRss/215005.htmlhttp://m.tkk7.com/dance-elephant/services/trackbacks/215005.htmlclass OneException extends Exception {
public OneException(String s){
super(s);
}
}
class TowException extends Exception{
public TowException(String s){
super(s);
}
}
public class RethrowNew{
public static void f()throws OneException{
System.out.println("originationg the exception in f()");
throw new OneException("thrown from f()");
}
public static void main(String[] agrs)throws Throwable{
try{
f();
}
catch(OneException e){
System.err.println("caught in main,e.printstacktrace()");
e.printStackTrace(System.err);
throw e;
}
}
}
鍦╩ain()鐨刢atch()涓垜鎶涘嚭寮傚父e錛歵hrow e錛涗絾涓嶇煡榪欎釜寮傚父濡備綍琚崟鑾鳳紝鍝綅
楂樻墜鍙互甯皬寮熻В鍐充竴涓嬪晩銆?br />
涓婅堪紼嬪簭鐨勮繍琛岀粨鏋滃涓嬶細
originationg the exception in f()
caught in main,e.printstacktrace()
OneException: thrown from f()
at RethrowNew.f(RethrowNew.java:15)
at RethrowNew.main(RethrowNew.java:19)
Exception in thread "main" OneException: thrown from f()//涓嶇煡閬撹繖孌典俊鎭浣曞嚭鏉?br />
at RethrowNew.f(RethrowNew.java:15)
at RethrowNew.main(RethrowNew.java:19)