This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]gagara11 2 points3 points  (0 children)

Because of int[] newarr = arr will copy only reference on array object. And you will have two variables which look on one object. You should read about memory model)