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
Why are the destructors for base class and derived class called in reverse order when the program exits
What is == in java?
Why set is used in java?
What is a arraylist in java?
What is the difference between serial and throughput garbage collector?
How to store image in arraylist in java?
What is arraylist class in java?
Write a program to show whether a graph is a tree or not using adjacency matrix.
What is the difference between this() and super() in java?
2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?
Explain what access modifiers can be used for methods?
If we don’t want some of the fields not to serialize how to do that?
What is mysql driver class name?
What are the advantages of unicode?
Explain about interrupt() method of thread class ?