Two Laptop Bag*
The moose likes Java in General and the fly likes HashMap and LinkedHashMap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "HashMap and LinkedHashMap" Watch "HashMap and LinkedHashMap" New topic
Author

HashMap and LinkedHashMap

S Majumder
Ranch Hand

Joined: Jun 03, 2009
Posts: 244
Hi exery body what is the difference between HashMap & LinkedHashMap ?

regards,
S
Muhammad Khojaye
Ranch Hand

Joined: Apr 12, 2009
Posts: 449

Please search. Surely, you will get many valuable replies.


http://muhammadkhojaye.blogspot.com/
Jitendra Takalkar
Greenhorn

Joined: Jan 12, 2007
Posts: 9
HashMap is an implementation of Map interface. LinkedHashMap which extends HashMap i.e. implementation of Map interface. The differnce between the HashMap and LinkedHashMap is in the way of implementation of Hash table.

HashMap:
no guarantees as to the order of the map

LinkedHashMap:
it maintains a doubly-linked list running through all of its entries. This linked list defines the iteration ordering.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: HashMap and LinkedHashMap
 
Similar Threads
What is a data structure for Map that preserves insert order?
Map Question
LinkedHasMap Question
Objects and Collections
displaying key of a hashmap,wrong order