`
public class Swap {
    public static void main(String[] args) {
        int a = 10;
        int b = 20;
        swap(a, b);
        System.out.println(a + " " + b);
        
        int[] arr = {1, 3, 2, 45, 6};
        change(arr);
        System.out.println(Arrays.toString(arr));
    }
    static void swap(int num1, int num2) {
        int temp = num1;
        num1 = num2;
        num2 = temp;
      
    }
    static void change(int[] nums) {
        nums[0] = 99; 
    }
}
// Why changes by change() function is done but if I do changes with swap() not happing
Current Output
10,20
[99,3,2,45,6]
My Expected Output
20,10
[99,3,2,45,6]
`
Why changes by change() function is done but if I do changes with swap() not happing
Current Output 10,20 [99,3,2,45,6]
My Expected Output 20,10 [99,3,2,45,6]
