How are you printing out the results?
I get:
System.out.println("oddNumbers=" + Arrays.toString(oddNumbers)); // oddNumbers=[5, 7, 9, 9, 9]
Type: Posts; User: Norm
How are you printing out the results?
I get:
System.out.println("oddNumbers=" + Arrays.toString(oddNumbers)); // oddNumbers=[5, 7, 9, 9, 9]
Did the error message give the value of the index that was out of bounds?
Was the value 5?
Remember the maximum index of an array is the array.length -1;
What does your for loop allow the index...