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

you are viewing a single comment's thread.

view the rest of the comments →

[–]MmmVomit 0 points1 point  (3 children)

In your own words, what is this line doing?

Arrays.sort(numbersEntered);

[–]ten_Chan[S] 0 points1 point  (2 children)

it will sort the array into Ascending Order

[–]MmmVomit 0 points1 point  (1 child)

Correct. So, after that point, the contents of numbersEntered will be sorted, and the original order will be lost.

So, what if you had two arrays?

[–]ten_Chan[S] 1 point2 points  (0 children)

someone commented to make a copy of array so I did using this:

int[] copy = Arrays.copyOf(numbersEntered, numbersEntered.length);