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 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.

Computer Science & Information Technology

You might also like to view...

The Form acts as a(n) __________ for the controls that are added.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Try to map the relational schema of Figure 6.14 into an ER schema. This is part of a process known as reverse engineering, where a conceptual schema is created for an existing implemented database. State any assumptions you make.

What will be an ideal response?

Computer Science & Information Technology

Which of the following is not a category of functions?

A) Financial B) Statistical C) Logical D) Graphing

Computer Science & Information Technology

Jerry sells cars at one company. His monthly salary is calculated each month by adding a commission of 5% of his monthly sales to a base pay of $1,310. If Jerry sells several cars worth a total of $62000 during this month, calculate his gross pay. Round your answer to the nearest cent.Jerry's gross pay is $__________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology