Dedian |
|
|||
-- 關(guān)注搜索引擎的開發(fā) |
日歷
統(tǒng)計(jì)
導(dǎo)航常用鏈接留言簿(8)隨筆分類(45)
隨筆檔案(82)
文章檔案(2)Java Spaces搜索積分與排名
最新評(píng)論
閱讀排行榜評(píng)論排行榜 |
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>();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>();
|
![]() |
|
Copyright © Dedian | Powered by: 博客園 模板提供:滬江博客 |