public static void main(String[] args) {
int x = 2;
int y = 3;
Algo(x, y);
}
public static void Algo(int x, int y) {
int tempX = x;
x = y;
y = tempX;
System.out.printf("x = %d \ny = %d", x, y);
}
stackoverflow 2
i
ilya.gorbunov
09/27/2017, 3:25 PM
@kotlin_questions Does this assignment require the original variables (x and y in main) being swapped as well?