代码:
protected void collectionsExample() {
ArrayList<String> list = new ArrayList<String>();
list.add(new String("test string"));
}
ArrayList<String>这种用法是JDK1.5中的新机能,但我使用了就是编译不过。
第二行编译出错,显示ArrayList cannot be resolved to a type,Syntax error,parameterized types are only available if source level is 5.0.
我的环境是WinXP,Eclipse3.1.2(Jre已经是1.5.0_06),请经验大虾指点。
protected void collectionsExample() {
ArrayList<String> list = new ArrayList<String>();
list.add(new String("test string"));
}
ArrayList<String>这种用法是JDK1.5中的新机能,但我使用了就是编译不过。
第二行编译出错,显示ArrayList cannot be resolved to a type,Syntax error,parameterized types are only available if source level is 5.0.
我的环境是WinXP,Eclipse3.1.2(Jre已经是1.5.0_06),请经验大虾指点。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货