Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 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.