bestseal的专栏

Today is the day to move forward towards your bright tomorrow.

原创  打印错误信息 收藏

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... ) | 编辑| 举报| 收藏

旧一篇:Java 设计模式-工厂模式 | 新一篇:关于synchronized

  • 发表评论
  • 评论内容:
  •  
Copyright © bestseal
Powered by CSDN Blog