What is the output of the following Java program?
public class Main {
static void swap(int a, int b) {
int t = a; a = b; b = t;
System.out.print(a + " " + b + " | ");
}
public static void main(String[] args) {
int x = 1, y = 2;
swap(x, y);
System.out.println(x + " " + y);
}
}
The method swaps its own copies; the caller's x and y are unchanged.