what is the difference between HashMap And HashTable?

Answer Posted / venkateswarlu

HashMap :
->It is a key,value pair.
->key are not duplicated but values can be duplicated.
->Null key is possible.
->It is not Synchronized by default.

Hashtable:
->It is also key,value pair but both are Strings only.
-> Keys are not duplicated but values can be duplicated.
->Null insertion is not possible of both(key and value).
->It is Synchronized by default.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between a vector & an array list?

905


What does java ide mean?

836


What is string data type?

745


How many bits is a word?

781


A person says that he compiled a java class successfully without even having a main method in it? Is it possible?

812


Why is java logo a cup of coffee?

820


What is a class reference?

770


What is mvc in java?

787


How to display names of all components in a Container?

2696


Is ruby built on java?

718


What is qualitative variable?

728


Can subclass overriding method declare an exception if parent class method doesn't throw an exception?

751


What is t in generics in java?

800


How to check if linked list contains loop in java?

652


How do you generate random numbers in java?

747