我收到通用数组错误,但是我不认为我正在尝试实例化通用数组。数组的类型为Double,这意味着它不应该是通用的,不是吗?
public class PolynomialSet extends Set<Polynomial<Double>>{
public PolynomialSet(int size){
elements = new Polynomial<Double>[size];
}
public class Polynomial <Domain> {}
public class Set<Type> {
protected Type[] elements;
protected int cardinality;
public int size(){
return elements.length;
}
public Type get(int k){
return elements[k];
}
public void set(int k, Type in){
elements[k]=in;
}
}