import java.util.*;
class A{
public static void main(String[] args){
}
private List <B> bList;
private Random generator = new Random();
A(List<B> initialList){
bList = new ArrayList<B> ();
int listSize = initialList.size();
bList.ensureCapacity(listSize);
for (B b : initialList) {
int bIndex = generator.nextInt(listSize);
bList.add(bIndex , b);
}
}
}
class B{
}
我一直在阅读错误
线程“主”java.lang.RuntimeException 中的异常:无法编译的源代码 - 错误的符号类型:java.util.List.ensureCapacity