[code="java"]
public List getValues(Class c) throws Exception{
List values = new ArrayList();
T o= c.newInstance();
values.add(o);
return values;
}
[/code]
这个是从一个类文件拷出来的代码
List 为什么要这样写
我感觉[code="java"]
public List getValues(Class c) throws Exception{
List values = new ArrayList();
T o= c.newInstance();
values.add(o);
return values;
}
[/code]
这样写就是正确的
事实拷出来的代码在新的类里确实正常
关键是在原类会报错
Multiple markers at this line
- T cannot be resolved to a type
- T cannot be resolved to a type
--Eclipse 提示
非常不理解 为什么