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 |
How a component can be placed on Windows?
how to search the pertical objects in a Collections
What restrictions are placed on the values of each case of a switch statement?
If we opened Windows Internet Explorer 4 times, does it starts 4 processes or 4 threads?
Why are component architectures useful?
Write a java program to find out the sum of harmonic series : 1 + ½ + 1/3 + ……… up to nth term , for any value of n.
What is Remote Server?
java is fully object oriented languages or not? why?
Give me simple example of hibernate caching and explain the details of caching????? thanks in adv.
Differences between applications and applets?
Explain about RMI Architecture?
When is the best time to validate input?