This is my first post here, so please be friendly! :)
Let's say I have this code:
public static void reassign (int[] nums) {
int[] A = {10,11,22};
A = nums;
}
public static void main(String[] args) {
int[] nums = {0,2};
reassign(nums);
System.out.println(nums[1]);
}
Why is my answer 2, and not 11? Does it have something to do with the relative sizes of the arrays?