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
Can we declare an array without size in java?
Can we overload run() method in java?
Can we overload the constructors?
Can we override the overloaded method?
How does thread synchronization occurs inside a monitor?
Can java run on google chrome?
what do you understand by the term string with respect to java?
Which variables are stored in heap?
How many characters is 16 bytes?
Is null a string in java?
What is the difference between abstract classes and interfaces?
What are the data types supported by java?
Differentiate between static and non-static methods in java.
What is the difference between heap and stack memory?
What is toarray method in java?