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

Explain about narrowing conversion in java?

570


Can you declare the main method as final?

531


Hi friends am new to java. I read jar file means collection of java files. For executing struts application what are the necessary jar files. " struts.jar " file contains what. can u explain

1438


Is 0 true or false?

519


How many return statement are allowed in a function?

461






Difference between static synchronization vs. Instance synchronization?

568


What is :: operator in java?

511


what is meant by Garbage collection?

622


We are seeing so many videos/audios as many web sited. But question is these videos or audios are stored in Databases ( Oracle, Mysql, Sybase,... ) or stored any file directory from there they will give the link for that? Pls explain and give sample code to achieve this one? Thanks, Seenu.

1493


What is string array?

584


What is a literal coding?

517


How many days will it take to learn java?

519


Implement 2 stacks with just 1 array. The stack routines must not indicate overflow unless every slot in array is used.

838


Can we override final method?

571


What is a local class in java?

589