public class Test {
/**
* @param args
*/
public static void main(String[] args) {
try{
int a = 0;
int b = 3;
int c = b/a;
}catch(Exception e){
e.printStackTrace();
Object obj[] = e.getStackTrace();
for( int i = 0; i < obj.length; i++){
System.out.println(obj[i].toString());
}
}
}
}
将捕捉到的异常完整的在屏幕上输出,代码如上:(再次鄙视CSDN,天天改变用户使用习惯,技术盲加商业盲)
发表于 @ 2008年07月22日 16:20:00 | 评论( loading... ) | 举报| 收藏