tag:blogger.com,1999:blog-8712770457197348465.post1030820892438160372..comments2024-03-18T23:01:42.768-07:00Comments on Javarevisited: How to sort HashMap by key and value in Java - Hashtable, Map Example Tutorialjavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-8712770457197348465.post-84178956232732488692016-06-18T19:58:27.952-07:002016-06-18T19:58:27.952-07:00@Unknown, can you give more details? do you mean d...@Unknown, can you give more details? do you mean duplicate values? as HashMap doesn't allow duplicate keys?javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-62801654318964184342016-06-18T09:23:12.821-07:002016-06-18T09:23:12.821-07:00It does not retain duplicates.It does not retain duplicates.Anonymoushttps://www.blogger.com/profile/14526401654260248180noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-23222806491402220932015-08-15T08:53:20.118-07:002015-08-15T08:53:20.118-07:00@Himanshu, for sorting you need to do comparison a...@Himanshu, for sorting you need to do comparison and for that you either need to extend Comparable interface or Comparator interface, choice is yours. javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-86186675211469750582015-08-06T10:33:52.904-07:002015-08-06T10:33:52.904-07:00is sortByKey Method , why generic value (V) requir...is sortByKey Method , why generic value (V) required to extends comparable class. Can 't we do without that line?Anonymoushttps://www.blogger.com/profile/13512594495906541395noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-72643524478788135212013-01-17T18:03:39.070-08:002013-01-17T18:03:39.070-08:00Why can't you use the SortedMap Interface prov...Why can't you use the SortedMap Interface provided by the API?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-68123541109808488352012-12-19T21:41:49.566-08:002012-12-19T21:41:49.566-08:00When we sort HashMap by values, does it retain dup...When we sort HashMap by values, does it retain duplicates or they lost during sorting operation ?Anonymousnoreply@blogger.com