I\'ve got a HashSet with a bunch of Integers in it. I want to turn it into an array, but calling
HashSet
Integers
hashset.toArray();
You can convert a Set to Integer[] even without Apache Utils:
Set
Integer[]
Set myset = new HashSet(); Integer[] array = myset.toArray(new Integer[0]);
However, if you need int[] you have to iterate over the set.
int[]