Hi All,
I have a doubt on sorting a map
i explain the steps i followed.
1. put the keys and values in different collections
2.sort the values
3.iterate through sorted values,then iterate through the key set.
4.get the value from the unsorted map w.r.t to the key iteration
5.compare the value with the iterated value.
6.put the key and value into a sorted map if the comparison succeeds.
when i print the key an value after the successful comparison, i get the out put as required,i.e the output is sorted w.r.t. values.
but when the same output is inserted into a sorted map. I get the output as sorted w.r.t. keys.
what am i missing here.Is there a map which give the output in first in first out
pattern
I code is below
Regards,
Shasi Sekar