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


Please Help Members By Posting Answers For Below Questions

What is the use of inner class?

729


What is the difference between comparison done by equals method and == operator?

755


Is string serializable in java?

718


What is xslt in java?

708


Is string is a class in java?

677






What is the difference between length and length () in java?

702


Is cout buffered?

865


Explain what are final variable in java?

766


Why synchronization is important in java?

760


When parseint method can be used?

696


How to handle a web browser resize operation?

728


What is the use of string and stringbuffer?

737


Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?

913


What is the difference between a field variable and a local variable?

751


why using interface interface ?

1737