1
在Combinator的类:问题
public static <KEY, T> void getCombsIntoTreeMap(int N, int K,
TreeMap<KEY, T> map,
Class<? extends KEY> keyIstance,
Class<? extends T> valueIstance)
{...}
和小样类;
TreeMap<Hand, int[]> mappa = new TreeMap<Hand, int[]>();
int[] keyIstance = new int[2];
Hand valueIstance = new Hand(new int[]{0});
Combinator.getCombsIntoTreeMap(53, 5, mappa,
keyIstance.getClass(),
valueIstance.getClass());
;
编译器只是说:
Comp.java:85: <KEY,T>getCombsIntoTreeMap(int,int,java.util.TreeMap<KEY,T>,java.lang.Class<? extends KEY>,java.lang.Class<? extends T>) in Combinator cannot be applied to (int,int,java.util.TreeMap<Hand,int[]>,java.lang.Class<capture#86 of ? extends int[]>,java.lang.Class<capture#138 of ? extends Hand>)
Combinator.getCombsIntoTreeMap(53, 5, mappa, keyIstance.getClass(), valueIstance.getClass());
^
我需要帮助。
感谢
似乎你有'keyIstance'和'valueIstance'错误的方式在某处。 – 2011-03-12 20:57:49
对不起...我没有使用&lt;&gt;&gt; – StefanoS 2011-03-12 20:58:38