为什么捕获异常之后的输出语句没有被成功执行呢?

public class XTException extends Exception {

public XTException(String msg){
    super(msg);
}

}

 public class Demo {
    public int div(int a,int b) throws XTException{
        int c = a/b;        
        return c;
    }
}

public class Test {
public static void main(String[] args) {
Demo d = new Demo();
try {
System.out.println(d.div(10, 0));
} catch (XTException e) {
e.printStackTrace();
}
System.out.println("为什么不可以输出这句话?");

}

}

他抛出的是ArithmeticException异常而不是XTException异常,你的catch里只写了XTException异常以至于没有捕获到应该处理的异常信息,所以程序崩溃了