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

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

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

    午夜拍鍵驚奇
    子夜 編程 代碼與我同在
    posts - 48,comments - 118,trackbacks - 79

    “Ease of Development”是J2SE 1.5的主要賣點。為此,這一版本加入了七種新的語言特性——Enhanced for Loop、Autoboxing/Auto-Unboxing、Varargs、Static Import、Enumeration、Metadata和Generics。使用這些特性,可以讓編寫出來的程序更簡練、更清晰、更不容易出錯,從而簡化開發的過程。

    Joshua Bloch(《Effective Java》的作者,J2SE 1.5的主要開發人員之一)效仿William Blake(1757-1827,英國詩人)的《Tiger》一詩,為這些特性撰寫了這樣一組詩篇:

    詠Tiger

    Tiger, Tiger burning bright
    Like a geek who works all night
    What new-fangled bit or byte
    Could ease the hacker"s weary plight?

    這一首是總說Tiger中的能使開發變得簡單的各種新語言特性。

    詠Enhanced for Loop

    While Iterators have their uses
    They sometimes strangle us like nooses
    With enhanced-for"s deadly ray
    Iterator"s kept at bay

    這一首單表Enhanced for Loop機制提供了一種更簡單的遍歷數組、Collection和其它實現了java.lang.Iterable接口的對象的方法。

    詠Autoboxing/Auto-Unboxing

    When from the collections ints are drawn
    Wrapper classes make us mourn
    When Tiger comes, we"ll shed no tears
    We"ll autobox them in the ears

    這一首單表Autoboxing機制/Auto-Unboxing提供了一種更簡單的整合兩套不同的類型系統(基本類型和引用類型)的機制。

    詠Varargs

    O joyless nights, o joyless days
    Our programs cluttered with arrays
    With varargs here, we needn"t whine;
    We"ll simply put the args inline

    這一首單表Varargs機制提供了一種更簡單的傳遞個數可變的實參的方法。

    詠Static Import

    And from the constant interface
    We shall inherit no disgrace
    With static import at our side
    Our joy will be unqualified

    這一首單表Static Import機制提供了一種更簡單的訪問靜態成員的機制。

    詠Enumeration

    The int-enum will soon be gone
    Like a foe we"ve known too long.
    With type safe-enum"s mighty power
    Our foe will bother us no more

    這一首單表Enumeration機制提供了一種更簡單的定義“類型安全的枚舉類”的方法。

    詠Metadata

    As for noble metadata
    I"ll have to sing its praises later
    Its uses are so numerous
    To give their due, I"d miss the bus

    這一首單表Metadata機制提供了一種更簡單的定義“機器可讀的說明信息”的機制。

    詠Generics

    To the most despised collections" cast
    We"ll bid a fond farewell at last
    With generics" burning spear
    The need for cast will disappear

    這一首是說用Generics機制,可以免去很多強制類型轉化的步驟的事情。Generics機制還有些其它用法,在這里沒有提到。

    posted on 2005-09-08 16:59 ^ Mustang ^ 閱讀(1209) 評論(0)  編輯  收藏 所屬分類: Java 點滴
    主站蜘蛛池模板: 日韩精品视频免费网址| 美女网站免费福利视频| 久久久久亚洲精品无码网址 | 国产大片51精品免费观看| 亚洲日韩AV一区二区三区四区 | 成人免费无码精品国产电影| 久久国产亚洲精品| 成人最新午夜免费视频| 亚洲精品无播放器在线播放| 精品国产免费一区二区| 精品女同一区二区三区免费播放| 免费h成人黄漫画嘿咻破解版| 国产99久久亚洲综合精品| 亚洲女同成人AⅤ人片在线观看| 成年免费大片黄在线观看com| 激情97综合亚洲色婷婷五| 中文字幕日本人妻久久久免费| 亚洲国产精品久久久久婷婷软件| 久久永久免费人妻精品下载| 亚洲三级中文字幕| 日本不卡高清中文字幕免费| 窝窝影视午夜看片免费| 久久久亚洲精品国产| 黄色网址免费大全| 污视频网站免费观看| 亚洲女久久久噜噜噜熟女| 88av免费观看| 大桥未久亚洲无av码在线| 亚洲精品白浆高清久久久久久| 免费女人高潮流视频在线观看| 亚洲熟妇AV一区二区三区浪潮| 国产亚洲精品无码拍拍拍色欲| 亚洲高清免费在线观看| 亚洲AV无码精品国产成人| 亚洲精品美女久久久久99| 青青在线久青草免费观看| jizz免费在线观看| 亚洲Av高清一区二区三区| 国产性爱在线观看亚洲黄色一级片| 免费A级毛片无码专区| 亚洲av日韩aⅴ无码色老头|