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
How many ways can we create singleton class?
What is the method overriding?
What methods are used in Servlet?Applet communication?
What is logical variable?
How big is a gigabyte?
When does an object becomes eligible for garbage collection in java?
What's a method in programming?
Can a final variable be manipulated in java?
How do you use compareto in java?
Explain purpose of sleep() method in java?
What is the static block?
What are three advantages of using functions?
What is the size of int?
What is object cloning in Java?
if u open login & logout ,how can udisplay the timelogin & logout members ?