I have a
HashMap<String,Integer> wordMap = new HashMap<String,Integer>();
I need to print the elements in such a way that they are in decreasing order of Integer values and the if two strings have same Integer values, they must be displayed in alphabetical order.
i.e If
HashMap={(it,2),(worst,1),(the,2),(of,2)}
,
The output should be::
it-2
of-2
the-2
worst-1