• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hashtable showing irregular results

 
Madhu Kaparapu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
i've encountered an strange result while working with hashtable.
I've noticed that the elements are not displyed in the order they were added to the table.
Can anybody plz let me know what meight be the reason?
Thanks all,
Madhu
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hashtable does not maintain the order of objects added to it.
If order is important, use LinkedHashMap
[ July 07, 2005: Message edited by: Mani Ram ]
 
Sunil Phani Manne
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is its intended behaviour. A Hashtable doesnt guarantee u the order. Read about collections framework in java for more details.

Regards,
Sunil Phani Manne
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic