<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Effective Java - Exception

    Exception's principle: Only have exceptions happened, use it, do not to use it control work flow, for three reasons: 1.when JVM optimize some common operation(e.g. for circle), when we use exception to instead it, JVM won't do optimize. 2. None of JVM used to optimize exception now. 3. Create and throw exception will take some JVM resources. 4. Hard to understand bussiness logic(my understanding). There is three kinds of Exception: Exception, RuntimeException, Error. Exception: Checked exception. RuntimeException: program error. Error: For environment error, JVM will handle it or define it. Error and RuntimeException 在表現形式上沒有區別, 代表出錯邏輯不同。 We should document the exception and don't catch or throw "Exception". Exception can be pass to high level throw transmit(轉義), it means we can transmate one kind exception(JDK exception) to another kind of exception(Bussiness exception). If we want to store the low level exception, can pass low level exception information throw "Exception chain", before JDK1.4, we should implemnts it by ourselves, we define a Throw field in our custom exception, and store the low level exception as its part, After JDK1.4, we can pass low level exception throw Construct. Two way to instead of exception: Return a value, get a "testing method"(Iterator.hasnext()).如果有狀態相關的方法, 最好有測試狀態相關的代碼。 User common exception like IllegalArgumentException, IllegalStateException, NullPointerException...

    posted on 2006-09-04 09:00 Sheldon Sun 閱讀(285) 評論(0)  編輯  收藏


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    <2025年7月>
    293012345
    6789101112
    13141516171819
    20212223242526
    272829303112
    3456789

    導航

    統計

    常用鏈接

    留言簿(3)

    隨筆檔案

    文章檔案

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 免费可以在线看A∨网站| 亚洲欧洲无码AV不卡在线| 一级毛片免费视频网站| 成人免费视频软件网站| 亚洲免费视频观看| 国产在线jyzzjyzz免费麻豆 | 黄在线观看www免费看| 亚洲综合精品香蕉久久网97| 国产免费拔擦拔擦8X高清在线人| 4338×亚洲全国最大色成网站| 搜日本一区二区三区免费高清视频| 国产伦精品一区二区三区免费迷| 久久综合亚洲色hezyo| 国产美女精品久久久久久久免费| 亚洲熟妇AV一区二区三区浪潮| 午夜男人一级毛片免费 | 国产精品亚洲αv天堂无码| 99re6在线视频精品免费下载| MM1313亚洲国产精品| 色偷偷亚洲男人天堂| 国产高清免费的视频| 免费夜色污私人影院网站电影| 亚洲精品成人久久久| 久久九九全国免费| 亚洲综合一区二区国产精品| 亚洲黄色免费电影| 亚洲欧美aⅴ在线资源| 亚洲综合久久夜AV | 精品无码AV无码免费专区| 天天爽亚洲中文字幕| 免费v片在线观看无遮挡| 国产亚洲精品免费视频播放| 97久久精品亚洲中文字幕无码| 黄页网站免费在线观看| 久久人午夜亚洲精品无码区| 国产亚洲AV无码AV男人的天堂| 18禁成人网站免费观看| 边摸边吃奶边做爽免费视频网站 | 亚洲狠狠ady亚洲精品大秀| 性感美女视频免费网站午夜| 2022免费国产精品福利在线|