Analyze the following code:
```
public class Test {
public static void main(String[] args) {
int[] x = {1, 2, 3, 4, 5};
xMethod(x, 5);
}
public static void xMethod(int[] x, int length) {
System.out.print(" " + x[length - 1]);
xMethod(x, length - 1);
}
}```
a. The program displays 1 2 3 4 6.
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.
d xMethod(x, 5) is invoked, then xMethod(x, 4), xMethod(x, 3), xMethod(x, 2), xMethod(x, 1), xMethod(x, 0). When invoking xMethod(x, 0), a runtime exception is raised because System.out.print(" "+x[0-1]) causes array out of bound.
You might also like to view...
The type of network used for communication among a laptop and smartphone using Bluetooth is a
a. WAN. b. PAN. c. LAN. d. MAN.
For a calculated field, the new field name must be followed by:
a. a bracket b. a colon c. an underscore