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

    隨筆檔案

    文章檔案

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 久久久高清免费视频| 亚洲狠狠爱综合影院婷婷| 成年人网站免费视频| 国产免费卡一卡三卡乱码| 亚洲精品无码久久久影院相关影片| 久久亚洲精品成人无码网站| 苍井空亚洲精品AA片在线播放| 成全视频在线观看免费| 岛国片在线免费观看| 中文字幕不卡亚洲| 亚洲av成人一区二区三区| 久久99久久成人免费播放| 在线看片免费不卡人成视频| 最新精品亚洲成a人在线观看| 九一在线完整视频免费观看| 午夜宅男在线永久免费观看网| 亚洲砖码砖专无区2023| 久久精品一本到99热免费| 国产亚洲综合网曝门系列| 免费精品99久久国产综合精品| 亚洲乱码国产一区网址| aaa毛片视频免费观看| 亚洲国产人成在线观看69网站| 51午夜精品免费视频| 丁香亚洲综合五月天婷婷| 亚洲最大的成人网| 国产成人精品男人免费| 亚洲国产午夜精品理论片在线播放| 7x7x7x免费在线观看| 亚洲人配人种jizz| 91短视频免费在线观看| 久久噜噜噜久久亚洲va久| 国产日韩久久免费影院| 亚洲综合一区二区国产精品| baoyu122.永久免费视频| 最新精品亚洲成a人在线观看| 亚洲一区免费观看| 亚洲精品一卡2卡3卡三卡四卡| 一区二区三区在线免费看| 亚洲男人的天堂久久精品| 亚洲精品黄色视频在线观看免费资源|