what is the difference between HashMap and Hashtable
Answer Posted / chandan phukan
Two main differences between Hastable and HashMap are
1. Hashtable is synchronised but HashMap is not.
2. Hashtable does not allow "null" key but HashMap allows
"null" Key.
However one point to remember is that only one "null" key is
allowed in HashMap but multiple "null" values are allowed in
HashMap.
| Is This Answer Correct ? | 75 Yes | 9 No |
Post New Answer View All Answers
What is the difference between break and continue statements?
What is the most important feature of java? What is an interface?
Is static a keyword in java?
How do you define a method?
What is the purpose of void?
What is the major difference between linkedlist and arraylist?
Can we use synchronized block for primitives?
Why do we use return statement?
What is the difference between static class and normal class?
Why does java does not support multiple inheritance? Explain
What are the 6 functions?
Can we call thread start () twice?
Does java have extension methods?
What is the flag in java?
What is the purpose of a transient variable?