Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
话题被移动
该话题已被移动 - littledeer1974 , 2004-10-29 14:42
如果您尚不清楚该话题被移动的原因,请参考论坛规则以及本版公告或者联系本版版主。
作者 Re:来来来,看看这个比较底层的问题 [Re:Biubiu]
SimonLei



CJSDN高级会员


发贴: 288
积分: 100
于 2002-12-07 12:00 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Biubiu wrote:
我的理解是jvm在执行以前要检查try/catch的语义没有被违反,即try block中的check point exception都应该被catch。这样,就要检查所有的方法调用是否抛出异常,以及这些异常是否被catch。


呵呵,总算搞得差不多明白了。
确实是检查try/catch,不过不是检查是不是都被catch了,
那是编译期检查的。而在runtime的时候,它要检查抛出
的Exception将和哪个catch语句匹配。

摘自:http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#88597

For efficiency reasons, certain tests that could in principle be performed in Pass 3 are delayed until the first time the code for the method is actually invoked. In so doing, Pass 3 of the verifier avoids loading class files unless it has to.

For example, if a method invokes another method that returns an instance of class A, and that instance is assigned only to a field of the same type, the verifier does not bother to check if the class A actually exists. However, if it is assigned to a field of the type B, the definitions of both A and B must be loaded in to ensure that A is a subclass of B.



You may say I am a dreamer, But I am not the only one.
My blog+wiki: http://blogsite.3322.org/

话题树型展开
人气 标题 作者 字数 发贴时间
5999 来来来,看看这个比较底层的问题 (try/catch) SimonLei 869 2002-12-06 16:21
4803 Re:来来来,看看这个比较底层的问题 Biubiu 215 2002-12-06 20:54
4686 Re:来来来,看看这个比较底层的问题 SimonLei 313 2002-12-06 23:41
4664 Re:来来来,看看这个比较底层的问题 SimonLei 287 2002-12-07 11:34
4697 Re:来来来,看看这个比较底层的问题 SimonLei 956 2002-12-07 12:00
4687 Re:来来来,看看这个比较底层的问题 Biubiu 55 2002-12-07 19:52
4612 Re:来来来,看看这个比较底层的问题 SimonLei 127 2002-12-07 20:04
5014 再给大家一个例子。 SimonLei 890 2002-12-07 21:25

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923