I am trying to sort an array of integers from highest to lowest.
int[] array = {2, 6, 4, 1};
Arrays.sort(array);
Collections.reverse(Arrays.asList(array));
for (int num : array) {
System.out.println(num);
}
This prints the array in an ascending order - 1, 2, 4, 6. Why is it not being reversed, or why is the array not being permanently stored in its reversed state?