what is the difference between HashMap and Hashtable
Answer Posted / jyotsna gupta
1. Hashtable is synchronized where as hashmap is not.
2. Hashmap can contains null values as the keys and as well as values.But Hashtable dose not allow null values as keys and values.
3. Another difference is that iterator in the HashMap is fail-safe while the enumerator for the Hashtable isn't. If you change the map while iterating, you'll know.
4. Hashmap is faster than Hashtable.
Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
How do you create a reference in java?
When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?
How will you serialize a singleton class without violating singleton pattern?
Is math an abstract class in java?
What are recursive functions? Give some examples?
What is the collections api?
What are exception handling keywords in java?
Why arraylist is used in java?
Is linkedlist thread safe in java?
What is a conditional statement explain with example?
What is variable explain?
How many bits is a 64 bit byte?
How does system arraycopy work in java?
What is the purpose of finalization in java programming?
What access modifiers can be used for methods?