Consider the Array
int[] arr = {1, 2, 3, 4, 5};
What are the values in arr after the following code is executed?
arr
for (int i = 0; i < arr.length - 2; i++)
{
int temp = arr[i];
arr[i] = arr[i+1];
arr[i+1] = temp;
}
12345
54321
23451
15432
OutOfBoundsException