I recommend you to use java.utils.Arrays.copyOf(originalArray, newLength). This will return you a copy of this array, but with newLength size.
The line


numbers = new int[x + 1];

is...