what is the difference between HashMap and Hashtable
Answer Posted / knowledge_finder
1. HashMap allows null values for key and value whereas
Hashtable doesnt allow.
2. HashMap does not guarantee that the order of the map will
remain constant over time. 3. HashMap is non synchronized
where as Hashtable is synchronized.
4. HashTable is an Old java class but Hashmap is a new java
class in java 2.
5. In HashTable you can change the iteration but in the case
of HashMap you can change the iteration but you will get a
java.util.ConcurrentModificationException.
Is This Answer Correct ? | 35 Yes | 5 No |
Post New Answer View All Answers
What is a default constraint?
Why do we use string?
What is difference between jdk,jre and jvm?
Can we use both this () and super () in a constructor?
Why hashmap is used in java?
Why declare Main() method as a static in java ?
How do we access static members in java?
When is the finalize() called?
What is difference between null and void?
How to sort elements in a parallel array in java?
Explain the init method?
'A class is a template for an object' explain this statement.
What is main in java?
Can we sort a map in java?
What is the use of set in java?