I am creating combinations of integer-arrays and adding them to a Vector to store them for later use.
I do the combination by looping over the int[] and then add the element to the vector.
Does the Vector only add the reference to the int[] and therfore I will keep lots of references to the same int[] at the end or does it add a copy to the Vector?
The arrays, including
int[]areObjects in Java. This means that yourVectoris holding references to yourint[]elements.However, I suggest you use
ArrayListinstead ofVectororCollections.synchronizedListif you really need a synchronized version of aList.