Show the output of the following code:
```
public class Test {
public static void main(String[] args) {
int[] x = {1, 2, 3, 4, 5};
increase(x);
int[] y = {1, 2, 3, 4, 5};
increase(y[0]);
System.out.println(x[0] + " " + y[0]);
}
public static void increase(int[] x) {
for (int i = 0; i < x.length; i++)
x[i]++;
}
public static void increase(int y) {
y++;
}
}
```
a. 0 0
b. 1 1
c. 2 2
d. 2 1
e. 1 2
d. 2 1
Invoking increase(x) passes the reference of the array to the method. Invoking increase(y[0]) passes the value 1 to the method. The value y[0] outside the method is not changed.
You might also like to view...
Which of the following is not a logical operator?
a. || b. = c. ! d. &&
DVI stands for ________
A) divided video integration B) digital video interface C) digital video integration D) defragmented video interface
The __________ are used to designate the source or destination of the data on the data bus.
A. system lines B. data lines C. control lines D. address lines
A(n) ____________________ is a schematic diagram that uses symbols to represent the parts of a technology solution or office workflow.
Fill in the blank(s) with the appropriate word(s).