Is there a fancy way to cast an Integer array to an int array? (I don\'t want to iterate over each element; I\'m looking for an elegant and quick way to write it)
T
If you have access to the Apache lang library, then you can use the ArrayUtils.toPrimitive(Integer[]) method like this:
int[] primitiveArray = ArrayUtils.toPrimitive(objectArray);