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
Is list ordered in java?
Is ruby built on java?
What is a parameter in simple terms?
What are variable names?
Which command from the jdk compiles a java program?
What an i/o filter?
Can we declare a constructor as final?
Give few examples of final classes defined in Java API?
Can variables be used in java without initialization?
How do you create an array in java?
What is the main advantage of passing argument by reference?
What is bufferedwriter?
Write a program to check for a prime number in java?
Can I uninstall java?
Can we declare array without size in java?