difference between HashMap, Hashset and hashTable?

Answer Posted / sujitpingale

HashMap -
1) unsynchronized and unordered
2) Allow one null key , multiple null values


HashTable -
1) synchronized and unordered
2) Doesn't allow null key and value


HashSet -
1) synchronized and ordered
2) Sort elements in ascending order , doesn't allow duplicate elements

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 a class loader?

586


What does module-relative mean?

575


How would you create a button with rounded edges?

560


What are local interfaces? Describe.

697


How primary key is implemented in Oracle?

1916






Can I import same package/class twice? Will the jvm load the package twice at runtime?

645


What are the steps to write p-to-p model application?

1959


If I wanted to use a solarisui for just a jtabbedpane, and the metal ui for everything else, how would I do that?

568


How are the elements of a cardlayout organized?

596


How a component can be placed on Windows?

2264


Is it possible to stop the execution of a method before completion in a sessionbean?

598


What is jboss?

571


What is difference between object state and behavior?

580


What value does read() return when it has reached the end of a file?

549


What is Stream Tokenizer?

1728