what is the difference between HashMap and Hashtable
Answer Posted / ashad
Hash Table is a legacy Class Whereas HashMap belongs to the
collections package.
HashMap allows null key and values..but it allows only one
null key and multiple null values...Whereas the HashTable
wont allow the null key and values..
HashMap allows only one null key, basic idea behind it is
that key can have unique value only if one null is assigned
to a key next null will be duplicate.
| Is This Answer Correct ? | 10 Yes | 9 No |
Post New Answer View All Answers
Why main method is static in java?
What is the difference between numeric and integer?
How do you detect memory leaks?
What is the difference between normal report & matrix report?
What is the difference between @before and @beforeclass annotation?
What does void * mean?
What are static blocks and static initalizers in java ?
In java, how we can disallow serialization of variables?
Which is faster set or list in java?
What are unchecked exceptions in java?
how we can create packages in java?
FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?
Explain try and catch keywords in java?
What’s the difference between constructors and other methods?
Does list maintain insertion order java?