有人可以向我解释为什么这种swap
方法不交换两个数字吗?
public class Test {
public static void main(String[] arr) {
int original1 = 5;
int original2 = 10;
swap(original1, original2);
System.out.println(original1);
System.out.println(original2);
}
static void swap(int a, int b){
int temp = a;
a=b;
b=temp;
}}