Privacy Policy Terms Of Use. Copyright © 2006-2010 Java Tutorials and Examples.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
1) Hashtable does not permit null keys while HashMap allows both null keys and values.
2) Hashtable is synchronized, while HashMap is not. If we need to synchronize it, we have to do it externally.
3) HashMaps work with Iterators where the older Hashtables work with Enumerations
4) As because HashMap is not synchronized, it is faster than hashtable.
5) Hashtables work best with capacities that are prime numbers. HashMaps round capacities up to power of two.

This is what I was looking
good answer....
Post new comment