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{
}
我已經越來越錯誤讀取的ensureCapacity不承認
異常在線程「主」了java.lang.RuntimeException:不可編譯的 源代碼 - 錯誤的符號類型:java.util.List.ensureCapacity