A simple way would be just to create another array with the same size as the old one:
Integer[] myArray = new Integer[10];
...
myArray = new Integer[myArray.length];
Is this better then using Arrays.fill() or looping through each element, setting it to null? I am not sure, but it is easy enough to
test.
"Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration."- Stan Kelly-Bootle