Answers for "how to sort an array from greatest to least"

1

how to sort an array from greatest to least

int [] tab2 = new int[]{1,5,0,-2};
Arrays.sort(tab2);
ArrayUtils.reverse(tab2);
System.out.print(Arrays.toString(tab2));
Posted by: Guest on October-02-2020

Code answers related to "how to sort an array from greatest to least"

Browse Popular Code Answers by Language