This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Frequent use of HashTable class. Why?

 
Campbell Ritchie
Sheriff
Pie
Posts: 49733
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On this recent thread, Joe Ess said that HashTable was the 2nd most frequently used class, after String.

Does anybody know why HashTable is used so frequently? Joe said it was used by the JVM for mapping purposes.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Campbell Ritchie:
Does anybody know why HashTable is used so frequently? Joe said it was used by the JVM for mapping purposes.

I've noticed HashTable showing up a lot in the profiler too even though we don't have ANY references to it in our code. Joe's explanation makes sense. Newer code would mostly use HashMap rather than HashTable. But the JVM was written before HashMap was invented.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49733
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much.
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Campbell Ritchie:
Joe said it was used by the JVM for mapping purposes.


Really by the JVM, or do you mean the Java API classes?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49733
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It wasn't me said it, it was Joe Ess, but yes, he said it was the JVM.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic