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
Why inputstreamreader is used in java?
What do you mean by data type?
What does microservices mean?
What is %d in printf?
What is null statement?
Is heap stored in ram?
Why we use set in java?
What is the difference between class & structure?
What is string array?
How to perform linear search in java?
What is method in java with example?
What is polymorphism java example?
why java uses class level type casting ?
What is treeset and treemap in java?
What is Classloader in Java?