Hi so I'm relatively new to programming so this might be a silly question.
So I have these lines of code in a run function:
int[] bstate = this.state;
System.out.println(Arrays.toString(bstate));
nextMove();
int[] astate = this.state;
System.out.println(Arrays.toString(astate));
System.out.println(Arrays.toString(bstate));
to check whether or not nextMove() had changed the state of the object, but I think when state was updated, bstate was updated too because after the method call, bstate was the same as astate where it wasn't before.
So I'm wondering if as my methods update state, they implicitly update bstate too and if so, how do I prevent this from happening?