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 assign integer value to char in java?
What are some characteristics of interference class?
What is the difference between conversation & casting?
How to sort an array from smallest to largest java?
What is json parser in java?
Break statement can be used as labels in java?
What are the advantages of java?
What is the use of predicate in java 8?
Where is java located?
What are the advantages of unicode?
Can constructor return value?
Explain thread life cycle in java?
Is null keyword in java?
When will we prefer to use set and list in java and why?
What does the exclamation mark mean in java?