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
Why is string immutable in java?
How many times may an objects finalize() method be invoked by the garbage collector?
What is a class loader? What are the different class loaders used by jvm?
Which javutil classes and interfaces support event handling?
how to make a index.jsp for running the site in internet and find an error for connection with weblogic server and java that give an error invalid object name.and how to maintain session.
Explain the advantages and disadvantages of detached objects.
What is the difference between RMI registry and OS Agent?
What is Remote Server?
Why do I get a duplicate name error when loading a jar file?
What is the purpose of the wait() method?
Why use a datasource when you can directly specify a connection details? (in a J2EE application)
What is table mutation and how do you avoid it?
What is the difference between the string and stringbuffer classes?
What are the difference between RMI and CORBA?
What is the difference between RMI and Corba?