File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hashtable

 
suman deb
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By default, Hashtable is unordered. Then, how can you retrieve Hashtable elements in the same order as they are put inside?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you really want to do this with Hashtable, you'd have to implement a mechanism yourself to remember the order in which the entries were inserted into the Hashtable.

But you'd better use LinkedHashMap, which already does this for you. Look it up in the API documentation.
[ August 23, 2005: Message edited by: Jesper de Jong ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic