我正在复习一个练习题,我只想知道程序如何得出答案的顺序---> 2 1 我在理解主驱动程序调用时遇到了困难。我了解这些方法的用法。
代码是:
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++;
}
}