I have an IntArray A.
int[] A={1,2,3};
and I copy it to B.
int[] B=A;
now I want to change element in A;
A[1]=B[2];
I would expect A now becomes {1,3,3} where B stays the same {1,2,3}.
Why is B changed to [1,3,3]?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…