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

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

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

    MDA/MDD/TDD/DDD/DDDDDDD
    posts - 536, comments - 111, trackbacks - 0, articles - 0
      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

    JDK5筆記

    Posted on 2011-10-07 15:05 leekiang 閱讀(505) 評論(0)  編輯  收藏 所屬分類: java
    1,SuppressWarnings的作用是抑制編譯器產生警告信息。
    @SuppressWarnings("unused")
    @SuppressWarnings("unchecked")

    eclipse支持的SuppressWarning的值如下,其他開發工具略有差異。
    • all to suppress all warnings
    • boxing to suppress warnings relative to boxing/unboxing operations
    • cast to suppress warnings relative to cast operations
    • dep-ann to suppress warnings relative to deprecated annotation
    • deprecation to suppress warnings relative to deprecation
    • fallthrough to suppress warnings relative to missing breaks in switch statements
    • finally to suppress warnings relative to finally block that don't return
    • hiding to suppress warnings relative to locals that hide variable
    • incomplete-switch to suppress warnings relative to missing entries in a switch statement (enum case)
    • nls to suppress warnings relative to non-nls string literals
    • null to suppress warnings relative to null analysis
    • restriction to suppress warnings relative to usage of discouraged or forbidden references
    • serial to suppress warnings relative to missing serialVersionUID field for a serializable class
    • static-access to suppress warnings relative to incorrect static access
    • synthetic-access to suppress warnings relative to unoptimized access from inner classes
    • unchecked to suppress warnings relative to unchecked operations
    • unqualified-field-access to suppress warnings relative to field access unqualified
    • unused to suppress warnings relative to unused code
    2,注解
    注解是加入到java源代碼中的一些描述性的數據,本身不能執行。可利用反射(當RetentionPolicy=RUNTIME)或文本解析取得注解信息。
    @Target,@Retention為元注解。
    SuppressWarnings的源碼如下:
    @Target({TYPE,?FIELD,?METHOD,?PARAMETER,?CONSTRUCTOR,?LOCAL_VARIABLE})
    @Retention(RetentionPolicy.SOURCE)
    public?@interface?SuppressWarnings?{
    ????String[]?value();
    }

    package?java.lang.annotation;

    public?enum?RetentionPolicy?{
    ????
    /**
    ?????*?Annotations?are?to?be?discarded?by?the?compiler.
    ?????
    */
    ????SOURCE,

    ????
    /**
    ?????*?Annotations?are?to?be?recorded?in?the?class?file?by?the?compiler
    ?????*?but?need?not?be?retained?by?the?VM?at?run?time.??This?is?the?default
    ?????*?behavior.
    ?????
    */
    ????CLASS,

    ????
    /**
    ?????*?Annotations?are?to?be?recorded?in?the?class?file?by?the?compiler?and
    ?????*?retained?by?the?VM?at?run?time,?so?they?may?be?read?reflectively.
    ?????*
    ?????*?
    @see?java.lang.reflect.AnnotatedElement
    ?????
    */
    ????RUNTIME
    }


    package?java.lang.annotation;
    public?enum?ElementType?{
    ????TYPE,
    ????FIELD,
    ????METHOD,
    ????PARAMETER,
    ????CONSTRUCTOR,
    ????LOCAL_VARIABLE,
    ????ANNOTATION_TYPE,
    ????PACKAGE
    }

    3,泛型

    ????public?<T>?T?testT(List<T>??list){
    ????????T?t?
    =(T)?list;
    ????????
    return?t;
    ????}

    4,自動裝箱(AutoBoxing

    關于row type
    http://stackoverflow.com/questions/2770321/what-is-a-raw-type-and-why-shouldnt-we-use-it/
    http://www.tkk7.com/sevenguin/archive/2011/04/20/348628.html

    轉:J2SE5中的最新注釋功能SuppressWarnings
    http://wenku.baidu.com/view/9d20440f844769eae009edf2.html
    實戰篇:設計自己的Annotation
    Supported Values for @SuppressWarnings
    主站蜘蛛池模板: 啦啦啦www免费视频| 日韩在线免费播放| 国产一级高青免费| 亚洲国产精品一区二区第四页 | 亚洲福利一区二区三区| 久久精品无码精品免费专区| 亚洲av日韩综合一区在线观看| 国产免费福利体检区久久| 亚洲视频免费播放| 国产91精品一区二区麻豆亚洲| 边摸边脱吃奶边高潮视频免费| 全部免费毛片在线| a在线视频免费观看在线视频三区 a毛片成人免费全部播放 | 亚洲精品无码永久在线观看你懂的 | 亚洲国产成人AV在线播放| 国产免费一区二区三区VR| 亚洲高清视频在线播放| 国产福利视精品永久免费| 亚洲午夜在线播放| 亚洲国产精品综合久久2007| 中字幕视频在线永久在线观看免费 | 亚洲午夜精品国产电影在线观看| 黄色网址大全免费| 亚洲色精品aⅴ一区区三区| 午夜免费福利视频| 最新亚洲卡一卡二卡三新区| **一级一级毛片免费观看| 亚洲中文字幕久久精品无码2021 | 免费大片黄手机在线观看| 深夜免费在线视频| 亚洲综合视频在线| 成人免费无码大片A毛片抽搐 | 麻豆成人精品国产免费| 亚洲免费无码在线| 亚洲欧洲日本国产| 亚洲AV无码专区日韩| 91禁漫免费进入| 天堂亚洲免费视频| 在线免费观看亚洲| 国产精品亚洲产品一区二区三区| 131美女爱做免费毛片|