difference between HashMap, Hashset and hashTable?
Answers were Sorted based on User's Feedback
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 |
Answer / 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 |
what is singleton class? where it mainly used in the projects?
Explain the difference between object state and behavior?
Why is main purpose of XML?
What are callback interfaces?
which of the following authentication is stronger than the others? a. Http Basic b. Http DIGEST c. Form based
What is a layout manager?
Which are the different segments of memory?
What is the difference between the font and fontmetrics classes?
what we can't do in jdbc but can do hibernate?
What are the services in RMI ?
What are the types of data passing mechanisams under JMS specification?
difference. between List and Set?
2 Answers Campus Interaction, HCL, Infotech,