The reason why you get null values as output is that you do not store any values in the array.
You can use the foreach loop to initialize the array, but then you must manually maintain a counter to reference the array elements:
for (Integer i : numbers ){
numbers[counter] = counter;
counter++;
}
Clearly, this is not the intended use case for the foreach loop. To solve your problem, I would suggest using the "traditional" for loop:
for (int i = 0; i < numbers.length; i++){
numbers[i] = i;
}
Note, it is possible to fill all elements with the same value using Arrays.fill(int[] array, int val).