惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
Cisco Talos Blog
Cisco Talos Blog
C
Check Point Blog
博客园_首页
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Martin Fowler
Martin Fowler
Recorded Future
Recorded Future
S
Security @ Cisco Blogs
L
LINUX DO - 最新话题
博客园 - 司徒正美
P
Privacy International News Feed
G
Google Developers Blog
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
K
Kaspersky official blog
I
InfoQ
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Webroot Blog
Webroot Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
大猫的无限游戏
大猫的无限游戏
D
Docker
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
Microsoft Azure Blog
Microsoft Azure Blog
Spread Privacy
Spread Privacy
量子位
H
Hacker News: Front Page
Simon Willison's Weblog
Simon Willison's Weblog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
SecWiki News
SecWiki News
S
Security Affairs
Latest news
Latest news
人人都是产品经理
人人都是产品经理
C
CERT Recently Published Vulnerability Notes
S
Security Archives - TechRepublic
V
Visual Studio Blog
T
Troy Hunt's Blog
S
Secure Thoughts
F
Fortinet All Blogs
V
V2EX
The Register - Security
The Register - Security
J
Java Code Geeks
MongoDB | Blog
MongoDB | Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

博客园 - kejian of 20

ResultSet详解 Java设计模式之适配器模式 MSSQL 2005转到MSSQL 2000的步骤 - kejian of 20 jsp的防sql注入通用程序 - kejian of 20 IIS 一机多站 JavaBean 简单介绍 java.lang.NoClassDefFoundError 关于在Eclipse中导入现有项目 jsp-sql server 2005 关于在ASP中使用在线编辑器——eWebEditor - kejian of 20 mysql简单命令 - kejian of 20 asp连接sqlserver - kejian of 20 JSP页面传递(乱码) - kejian of 20 jsp配置记录(连接MYSQL) - kejian of 20 java连接MYSQL - kejian of 20 服务器端XSLT - kejian of 20 从VCD中提取伴奏 - kejian of 20 不能用 '..' 表示父目录解决方法 - kejian of 20 耳机参数 - kejian of 20
关于e.printStackTrace()
kejian of 20 · 2007-10-28 · via 博客园 - kejian of 20

Posted on 2007-10-28 10:45  kejian of 20  阅读(2092)  评论(0)    收藏  举报

在抛出异常的情况下,有很多方法,先介绍两个我常用的。
原来我使用的是System.out.println(e);
这个方法打印出异常,并且输出在哪里出现的异常,不过它和另外一个e.printStackTrace()方法不同。后者也是打印出异常,但是它还将显示出更深的调用信息。
比如说:
 A   extends --->   B   extends  ----> C
当在创建A的过程中出现问题了,我们抛出异常。
System.out.println(e),除了标准异常外,只打印at A 然后再向外层层输出。
e.printStackTrace(),除了标准异常外,打印 
at   C
at   B
at   A
.......再向外层调查。 
在向外层调查的情况下,都一样。最后都会回到com.sun.midp.main.Main.main