Dedian  
          -- 關注搜索引擎的開發
          日歷
          <2006年5月>
          30123456
          78910111213
          14151617181920
          21222324252627
          28293031123
          45678910
          統計
          • 隨筆 - 82
          • 文章 - 2
          • 評論 - 228
          • 引用 - 0

          導航

          常用鏈接

          留言簿(8)

          隨筆分類(45)

          隨筆檔案(82)

          文章檔案(2)

          Java Spaces

          搜索

          •  

          積分與排名

          • 積分 - 65579
          • 排名 - 817

          最新評論

          閱讀排行榜

          評論排行榜

           
          Problem Description:

          I wanna build GData source code under Eclipse which contrains creating type-specific map codes, the Eclipse IDE will complain something like that:? Syntax error, parameterized types are only available if source level is 5.0

          Reason:

          The new feature to create a type-specific map can only be supported at source level 5.0

          Solution:

          Do some IDE compiler configuration:
          Window > Preferences > Java > Compiler > Compiler compliance level => 5.0

          Note:
          1. type-specific map:? create a map that will hold only objects of a certain type
          ??? example:
          Map<Integer, String> map = new HashMap<Integer, String>();

          map.put(1, "first");
          map.put(2, "second");
          2. if source level 5.0 is applied, Type-safe problem should be noticed for collection data type, such as Vector, List, Stack or Map etc.
          that means, you can write code under level 1.4 like this:

          private Vector MyList = new Vector();
          ...
          MyList.add(str);

          you'd better change to some stuff like this under level 5.0:

          private Vector<String> MyList = new Vector<String>();


          posted on 2006-05-17 09:41 Dedian 閱讀(400) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
           
          Copyright © Dedian Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 广水市| 调兵山市| 伊川县| 宁强县| 枞阳县| 武胜县| 墨竹工卡县| 黄骅市| 临汾市| 定襄县| 三都| 江孜县| 颍上县| 金昌市| 灵宝市| 抚松县| 吐鲁番市| 望城县| 黎平县| 嘉善县| 张家界市| 拜泉县| 合川市| 德令哈市| 仪征市| 建始县| 阿瓦提县| 安丘市| 和田县| 孟村| 靖州| 广平县| 安新县| 合肥市| 南平市| 木兰县| 逊克县| 昭苏县| 临清市| 合肥市| 泾源县|