In this article, we will discuss the most popular interview question in the Collection framework.
- HashMap allows one null key and multiple null values. But in another way Hashtable is not allowed null key or values.
- HashMap is non-synchronized means It does not contain any synchronized method. Hashtable is synchronized.
- HashMap performance-wise is good as compare to Hashtable.
- HashMap is used array and Linked-List for storing the key and values. Hashtable is used a hashtable data structure.
- HashMap is useful in a non-multithreaded environment and Hashtable is useful in a multithreaded environment
No comments:
Post a Comment