<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 閱讀(281) 評論(0)  編輯  收藏


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


    網站導航:
     
    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    導航

    統計

    常用鏈接

    留言簿(3)

    隨筆檔案

    文章檔案

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲产国偷V产偷V自拍色戒| 亚洲色大成网站WWW久久九九 | 又色又污又黄无遮挡的免费视| 中文字幕免费观看全部电影| 国产精品亚洲综合五月天| 亚洲AV无码成人精品区大在线| 黄a大片av永久免费| 国产福利免费视频 | 老司机午夜精品视频在线观看免费 | 少妇中文字幕乱码亚洲影视| 两性色午夜免费视频| 亚洲妓女综合网99| 亚洲综合色区在线观看| 国国内清清草原免费视频99| 一边摸一边桶一边脱免费视频 | 韩国免费一级成人毛片| 一个人看的在线免费视频| 亚洲另类春色校园小说| 自拍偷自拍亚洲精品情侣| 插B内射18免费视频| a毛片视频免费观看影院| 亚洲日韩一中文字暮| 亚洲国产精品久久久久婷婷软件| 国产一区二区三区免费在线观看| 精品无码AV无码免费专区 | 污污网站免费观看| 欧洲乱码伦视频免费国产| 亚洲免费视频播放| 久久亚洲精品成人| 亚洲精品岛国片在线观看| 毛片a级毛片免费观看品善网| 日韩免费在线视频| jizz免费在线影视观看网站| 亚洲成AV人片在WWW| 亚洲国产精品yw在线观看| 久久亚洲AV无码精品色午夜麻| 亚洲人午夜射精精品日韩| 在线观着免费观看国产黄| 毛片免费vip会员在线看| 69成人免费视频| 亚洲成av人在线观看网站|