java自定义异常类===代码问题
代码: package yichang; public class Nuli{ public static void main(String[] args){ Nuli one = new Nuli(); try{ one.shuchu(); }catch(Xinde e){ System.out.println("123"); e.printStackTrace(); } } public void shuchu() throws Xinde{ int a = 10; int b = 0; if(a == 10){ a = a/b; } } }
自定义异常类:
package yichang;
public class Xinde extends Exception {
public Xinde(String me){
super(me);
}
}
其它都正常,就是不输出 123,哪位大神帮忙看看,谢谢了