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 yield() and sleep()?

539


List any five features of java?

565


What is the exception hierarchy in java?

483


What are the difference between composition and inheritance in java?

510


What does exclamation mean in java?

571






What is java in detail?

557


what is object slice?

1573


What is the purpose of tostring() method in java?

552


What is the purpose of the return statement?

512


is there a separate stack for each thread in java? : Java thread

537


What is static import?

595


What is the difference between abstract classes and interfaces?

511


String class is defined under which package in java?

618


What is the symbol for line break?

606


Which class cannot be a subclass in java?

539