In the following code:
static void findSubsets (ArrayList<Integer> numbers, int amount, int index) { ArrayList <Integer> numbersCopy = new ArrayList<Integer>(numbers.size()); Collections.copy(numbersCopy, numbers); }
I get an error message:
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)
Why?
java collections arraylist indexoutofboundsexception
andandandand May 27 '11 at 3:47 a.m. 2011-05-27 03:47
source share