To retrieve the keys of a HashMap in sorted order,
1.Copy the contents of HashMap to TreeMap.
2.Add the keys the keys of HashMap to TreeSet
3.Pass the HashMap to Arrays.sort
4.Pass the HashMap to Collections.sort
1. false -> Copying the contents to TreeMap will sort the Map as per the values and not as per the keys
2. true -> When something is added to TreeSet, it is put in ordered manner. So, when keys are put into it, they are ordered
3. false -> This is used to sort the arrays not Map
4. false -> This is used to sort collection (ArrayList, Vector,etc) not Map