标签:nts lang rac stat 输出 cep lan ice ati
package com.chinadays.learn; public class TestException { public static void main(String[] args) { try { int i = 0; System.out.println(10 / i); } catch (Exception e) { System.out.println("TestException:" + e.toString()); System.out.println("Test:" + e.getMessage()); e.printStackTrace(); } } }
异常处理 输出堆栈内的信息:
TestException:java.lang.ArithmeticException: / by zero
Test:/ by zero
java.lang.ArithmeticException: / by zero
at com.chinadays.learn.TestException.main(TestException.java:9)
标签:nts lang rac stat 输出 cep lan ice ati
原文地址:http://www.cnblogs.com/anpajin/p/6323371.html