At a guess, when you created the array variables, either you assigned them both to the same area of memory, or you didn't assign them at all.
If you create your arrays like this:
int[] anArray;
anArray = new int[10];
int[] anotherArray = anArray;
then both array variables anArray and anotherArray share the same memory - so anything you do via one affect the memory the other uses.
You need to assign them separately:
int[] anArray;
anArray = new int[10];
int[] anotherArray;
anotherArray = new int[10];
to get separate memory for each.