File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sort of collections by Collections.sort(..)

 
Pawanpreet Singh
Ranch Hand
Posts: 264
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We know that we can only do sort of List by Collections.sort,

We can not do sort HashSet, HashMap and Hashtable.....because they are uordered. But LinkHashSet and LinkedHashMap are there as ordered by insertion.

So could anybody tell me that can we sort LinkHashSet and LinkedHashMap also by some way.

Sincerely,
Pawan
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want sorted sets and maps go for TreeMap and TreeSet.
 
Pankaja Shinde
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no way
we can't change the functionality of LinkedHashSet and LinkedHashMap.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic