Analyze the following code:

```
public class Test {
public static void main(String[] args) {
int[] oldList = {1, 2, 3, 4, 5};
reverse(oldList);
for (int i = 0; i < oldList.length; i++)
System.out.print(oldList[i] + " ");
}

public static void reverse(int[] list) {
int[] newList = new int[list.length];

for (int i = 0; i < list.length; i++)
newList[i] = list[list.length - 1 - i];

list = newList;
}
}```
a. The program displays 1 2 3 4 5.
b. The program displays 1 2 3 4 5 and then raises an ArrayIndexOutOfBoundsException.
c. The program displays 5 4 3 2 1.
d. The program displays 5 4 3 2 1 and then raises an ArrayIndexOutOfBoundsException.

a The contents of the array oldList have not been changed as result of invoking the reverse method.

Computer Science & Information Technology

You might also like to view...

The Layout gallery displays 10 slide layouts with a variety of placeholders to define text and content positioning and formatting.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

The ____ value measures from the left side of the browser window.

A. left-margin B. margin-left C. left-browser-side D. left-browser

Computer Science & Information Technology