New course! Every coder should learn Generative AI!
Try a free lesson+ 3
You could use:
Lowest to highest:
int [] intArray // init the array here
Arrays.sort(intArray);
Highest to lowest:
Same as lowest to highest, then add
ArrayUtils.reverse(intArray);
after sorting.