Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • It's true for both Hashtable and HashMap in jdk 1.6.0_22 by Sun/Oracle. Commented Feb 12, 2011 at 21:42
  • @Nikita: not sure about Hashtable, and I don't have access to the sources right now, but I am 100% certain HashMap uses chaining and not linear probing in every single version I've ever seen in my debugger. Commented Feb 12, 2011 at 21:45
  • @Michael Well, I'm looking at the source of HashMap's public V get(Object key) right now (same version as above). If you do find precise version where those linked lists appear, I'd be interested to know. Commented Feb 12, 2011 at 21:51
  • @Niki: I'm now looking at the same method, and I see it using a for loop to iterate through a linked list of Entry objects: localEntry = localEntry.next Commented Feb 12, 2011 at 22:17
  • @Michael Sorry, it's my mistake. I interpreted code in wrong way. naturally, e = e.next is not ++index. +1 Commented Feb 12, 2011 at 22:28