Learn sorting array in Java with example, how to sort an array in ascending and descending order using sort(), for loop, Comparator, reverseOrder