I have an array called look. It contains 10 items in it. How do i sort index 7 to 9 in the array in descending order? below is code i use sort index 0 to 6 in ascending.
Arrays.sort(look, 0, 6);
I have an array called look. It contains 10 items in it. How do i sort index 7 to 9 in the array in descending order? below is code i use sort index 0 to 6 in ascending.
Arrays.sort(look, 0, 6);
You can use the Arrays method:
public static <T> void sort(T[] a, int fromIndex, int toIndex, Comparator<? super T> c)
With help of the Comparator interface you can define you own sorting mechanism.
see: public static void sort(T[] a, int fromIndex, int toIndex, Comparator c)) and Comparator