Frnds, I want to know
how SortedMap works internally in comparing two key values while inserting elements in it. Because i want to override the compare method that it uses in comparing objects according, so can anyone explain it. Is it uses the compare method of Object class???
My problem is that i have some words with there freqency, now i want to sort the words according to their frequency, now the idea i have in my mind is that i just want insert the frequency of words as keys and words as values in SortedMap, but there are more than one 'same frequency words', so my key is not unique so it is not valid, so i make an object that have class count {String
word, int times} i.e. which word appear how many times. Now i want to insert in sortedmap as sortedmap.put(key objectOfCount, value objectOfCount). Now i want to know that how sortedmap works internally while putting the keys, i.e. is it compares one key with another using the compare method of Object class, or something else, so that i override that method and get my result.