<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)

    隨筆檔案

    文章檔案

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 国内一级一级毛片a免费| 亚洲AⅤ无码一区二区三区在线 | 亚洲卡一卡二卡乱码新区| 日本免费观看网站| 男人的好看免费观看在线视频| 亚洲日韩国产AV无码无码精品| 无人在线直播免费观看| 色多多免费视频观看区一区| 免费国产真实迷j在线观看| 最近国语视频在线观看免费播放| 亚洲国产日韩在线成人蜜芽| vvvv99日韩精品亚洲| 24小时免费看片| sss日本免费完整版在线观看| 亚洲理论片在线中文字幕| 午夜亚洲福利在线老司机| 8090在线观看免费观看| 免费观看四虎精品成人| 亚洲欧洲日产v特级毛片| 亚洲男人av香蕉爽爽爽爽| 久久WWW色情成人免费观看| 中文字字幕在线高清免费电影| 亚洲性无码一区二区三区| 亚洲成AV人片在线观看无| 免费a级毛片永久免费| 久久99九九国产免费看小说| 成人自慰女黄网站免费大全| 久久亚洲欧美国产精品| 亚洲女人初试黑人巨高清| 久久精品国产亚洲综合色| 五月天婷亚洲天综合网精品偷| 希望影院高清免费观看视频| 四虎国产精品永久免费网址| 4hu四虎免费影院www| 国产精品亚洲专区在线播放| 亚洲av日韩av综合| 亚洲精品一区二区三区四区乱码 | 国产精品亚洲w码日韩中文| 国产精品成人无码免费| 国产麻豆视频免费观看| 国产亚洲男人的天堂在线观看|