【发布时间】:2011-09-03 02:37:03
【问题描述】:
关于以下代码:
static void findSubsets (ArrayList<Integer> numbers, int amount, int index)
{
ArrayList <Integer> numbersCopy = new ArrayList<Integer>(numbers.size());
Collections.copy(numbersCopy, numbers);
}
我收到了错误:
Exception in thread "main" java.lang.IndexOutOfBoundsException: Source does not fit in dest
at java.util.Collections.copy(Collections.java:548)
at backtracking2.Main.findSubsets(Main.java:61)
为什么?
【问题讨论】:
标签: java arraylist collections indexoutofboundsexception