what is the difference between HashMap and Hashtable
Answer Posted / tarun kumar
class Hashtable was part of the original java.util and is a
concreate implementation of a Dictionary class. In java2 it
is reengineering it so that it also implements the Map
interface.
Thus it is now integrated into the collections framework.
class HashMap implements Map interface.
Because, Hashtable is a concreate implementation of
Dictionary class, is Legacy class, all legacy classes are
synchronized. So,thats why Hashtable is sunchronized.
I can say that both Hashtable and HashMap are same, accept
synchronization.
| Is This Answer Correct ? | 22 Yes | 25 No |
Post New Answer View All Answers
Does it matter in what order catch statements for filenotfoundexception and ioexception are written?
What is a boolean expression in java?
What is formatted output in java?
Is hashmap thread safe?
What does three dots mean in java?
Explain different forms of polymorphism?
How do you use nextline in java?
What is * argv?
Why to use nested classes in java?
What does t in java mean?
Do loops java?
What are desktop procedures?
What are the supported platforms by java programming language?
I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?
What is static method with example?