<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 :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

    JDK5筆記

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

    eclipse支持的SuppressWarning的值如下,其他開發(fā)工具略有差異。
    • 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,注解
    注解是加入到j(luò)ava源代碼中的一些描述性的數(shù)據(jù),本身不能執(zhí)行。可利用反射(當(dāng)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,自動(dòng)裝箱(AutoBoxing

    關(guān)于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

    轉(zhuǎn):J2SE5中的最新注釋功能SuppressWarnings
    http://wenku.baidu.com/view/9d20440f844769eae009edf2.html
    實(shí)戰(zhàn)篇:設(shè)計(jì)自己的Annotation
    Supported Values for @SuppressWarnings
    主站蜘蛛池模板: 七次郎成人免费线路视频| 亚洲视频在线免费播放| 亚洲VA综合VA国产产VA中| 国产伦精品一区二区三区免费迷 | 亚洲av成人综合网| 亚洲天堂中文字幕在线观看| 亚洲精品国产手机| 亚洲剧情在线观看| 亚洲一级毛片中文字幕| 亚洲乱码在线卡一卡二卡新区| 亚洲 欧洲 视频 伦小说| 亚洲欧美黑人猛交群| 噜噜综合亚洲AV中文无码| 国产99久久亚洲综合精品| 亚洲免费在线观看| 成人黄网站片免费视频 | 亚洲日产乱码一二三区别| 亚洲人成色在线观看| MM1313亚洲国产精品| 黄网站在线播放视频免费观看| 日韩a毛片免费观看| 国产又黄又爽又大的免费视频| 免费人成网站在线观看不卡| 精品无码AV无码免费专区| 一本岛高清v不卡免费一三区| 成人免费网站在线观看| 哒哒哒免费视频观看在线www| 亚洲精品国精品久久99热| 亚洲精品一品区二品区三品区| 久久精品亚洲精品国产色婷| 久久亚洲精品国产精品婷婷| 色婷婷精品免费视频| 99精品免费视品| 亚洲网站免费观看| 国产视频精品免费| 国产成人精品日本亚洲专区61| 日产亚洲一区二区三区| 亚洲五月丁香综合视频| 男女猛烈无遮掩视频免费软件| 久久久久久一品道精品免费看| 手机在线看永久av片免费|