【发布时间】:2015-02-27 19:31:15
【问题描述】:
我是 JAVA 的新手,如何使用 List 类型的对象创建一个类。
public class Information {
public String Name;
public double Age;
**public List<String> vechicleType=** new ArrayList<String>();**
}
我收到如下错误:
The type List is not generic; it cannot be parameterized with arguments <String>
是否可以在 hashmap 中使用它,例如:
我想使用 HashMap
HashMap<String, Information> hm = new HashMap<String,Information>();
谢谢!
【问题讨论】: