Assume that an array of integer values has been declared as follows and has been initialized.
int[] arr = new int[10];
Which of the following code segments correctly interchanges the value of arr[0] and arr[5]?
A)
arr[0] = 5;
arr[5] = 0;
B)
arr[0] = arr[5];
arr[5] = arr[0];
C)
int k = arr[5];
arr[0] = arr[5];
arr[5] = k;
D)
int k = arr[0];
arr[0] = arr[5];
arr[5] = k;
E)
int k = arr[5];
arr[5] = arr[0];
arr[0] = arr[5];