思维有些混乱,能否用俗语解释下这篇代码
public class ChainTest {
public static void main(String[] args) {
ChainTest ct=new ChainTest();
try{
ct.test2();
}catch(Exception e){
e.printStackTrace();
}
}
public void test1() throws DrunkException{
throw new DrunkException("开车别喝酒");
}
public void test2(){
try {
test1();
} catch (DrunkException e) {
// TODO Auto-generated catch block
RuntimeException newExc=new RuntimeException(e);
//newExc.initCause(e);
throw newExc;
}
}
}