我收到的错误不允许我在一个方法中实例化我的类,因为它说它是抽象的。但是,我没有声明类抽象,所以我不知道为什么会这样做。有什么建议?
public class myTemps implements Temperatures {
public myTemps(String[] array)
@Override
public ListOfStrings subList(int fromIndex) {
if (fromIndex>this.size()){
throw new IndexOutOfBoundsException();
}
Temperatures sub=new myTemps(10);
}
}
答案 0 :(得分:2)
您无法实例化界面,您需要
new MylistOfStrings(10);