I suspect there's something really fundamental behind this that I'm completely oblivious to. I can write
int b = 5;
int a = b;
a = 2;
From the best I can tell, this gives me two separate variables. Initially, a is set to 5, but then I can change a to 2 without changing b
However, I can then write
double[] b = { 1, 2, 3, 4};
double[] a = b;
a[2] = 9;
Now, it appears that instead of having 2 separate variables, I have 2 references to the same entity. Changing a[2] now changes b[2]. What's going on?