difference between HashMap, Hashset and hashTable?

Answer Posted / adarsh m thimmappa

HashTable is a hashing based key-value pair data structure
- doesn't allow null as key
- doesn't allow null as value as well
- not thread safe
- oldest map based data structure available since earlier versions of java

HashMap is a hashing based key-value pair data structure
- allow one null as key
- allows multiple null as more than one value
- not thread safe

HashSet is a hashing based set representation
- holds unique set of keys
- internally uses HashMap
- allows one null value
- not thread safe

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

whats is statement and procedure

1582


What is the difference between java class and bean?

576


What are transaction attributes?

609


What is an abstract method?

586


What is glasgow?

577






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

638


wahts is mean by dynavalidatorform in struts/

1561


what is a non-repeatable read?

1822


Is there a guarantee of uniqueness for entity beans?

564


What method is invoked to cause an object to begin executing as a separate thread?

564


What is the purpose of the notify() method?

590


How are the elements of a cardlayout organized?

590


If your ui seems to freeze periodically, what might be a likely reason?

538


Can I use javascript to submit a form?

603


What are the diff types of exception?

548