What is diffrence between HashTable and HashMap






What  is   difference  between  HashTable  and HashMap.   

     
       HashTable
   HashMap
Methods of Hashtable are synchronized by default
Methods are not synchronized by default
Does not permit null values (trying to add, throws NullPointerException)
Permits null values (either key or value)
Enumeration interface is used for iterating keys
Iterator is used for iterating the keys
Enumerator is not fail-fast
Iterator is fail-fast
Safe for multithreaded applications
Better for non-threaded applications
Low performance due to synchronization
High performance
Hashtable is serialized
HashMap is not serialized
What is diffrence between HashTable and HashMap What  is diffrence between HashTable  and HashMap Reviewed by Mukesh Jha on 4:24 AM Rating: 5

No comments:

Add your comment

All Right Reserved To Mukesh Jha.. Theme images by Jason Morrow. Powered by Blogger.