Linked Questions
93 questions linked to/from What are the differences between a HashMap and a Hashtable in Java?
22
votes
3
answers
2k
views
How is Hashtable different to Hashmap [duplicate]
Possible Duplicate:
Differences between HashMap and Hashtable?
I've seen hash tables and hash maps used in different code but they look like they do the same thing. Is there a difference between ...
5
votes
5
answers
3k
views
difference between hashmap and hashtable| [duplicate]
Possible Duplicate:
Differences between HashMap and Hashtable?
I went to an interview the other day interviewer asked me under which situation will there be a problem to use hashmap rather then ...
2
votes
6
answers
2k
views
Java hashtable or hashmap? [duplicate]
I've been researching to find a faster alternative to list. In an algorithm book, hashtable seems to be the fastest using separate chaining. Then I found that java has an implementation of hashtable ...
3
votes
0
answers
1k
views
ConcurrentHashMap and Hash table difference [duplicate]
I am new to Java and stackoverflow and am seeking answer from experienced folks, who have worked on Collections Framework.
I read that hashTable is thread safe and so is concurrentHashMap, but a ...
1
vote
0
answers
396
views
HashMap vs Hashtable (get & put) Implementation [duplicate]
I've been going through Java API java.util.HashMap and java.util.Hashtable
I've understood the internal implementation of get(Key k) and put(Key k, Value v)methods of HashMap, and Hashtableseems ...
1159
votes
18
answers
600k
views
What does 'synchronized' mean?
I have some questions regarding the usage and significance of the synchronized keyword.
What is the significance of the synchronized keyword?
When should methods be synchronized?
What does it mean ...
624
votes
11
answers
451k
views
Java Class that implements Map and keeps insertion order?
I'm looking for a class in java that has key-value association, but without using hashes. Here is what I'm currently doing:
Add values to a Hashtable.
Get an iterator for the Hashtable.entrySet().
...
299
votes
9
answers
206k
views
Java List.add() UnsupportedOperationException
I try to add objects to a List<String> instance but it throws an UnsupportedOperationException.
Does anyone know why?
My Java code:
String[] membersArray = request.getParameterValues('members')...
131
votes
20
answers
140k
views
When to use Comparable and Comparator
I have a list of objects I need to sort on a field, say Score. Without giving much thought I wrote a new class that implements Comparator, that does the task and it works.
Now looking back at this, ...
140
votes
14
answers
373k
views
Java: how to convert HashMap<String, Object> to array
I need to convert a HashMap<String, Object> to an array; could anyone show me how it's done?
112
votes
7
answers
183k
views
Difference between Dictionary and Hashtable [duplicate]
Possible Duplicate:
Why is Dictionary preferred over Hashtable in C#?
What is the difference between Dictionary and Hashtable. How to decide which one to use?
120
votes
6
answers
41k
views
HashMap Java 8 implementation
As per the following link document: Java HashMap Implementation
I'm confused with the implementation of HashMap (or rather, an enhancement in HashMap). My queries are:
Firstly
static final int ...
85
votes
13
answers
87k
views
Simplest and understandable example of volatile keyword in Java
I'm reading about volatile keyword in Java and completely understand the theory part of it.
But, what I'm searching for is, a good case example, which shows what would happen if variable wasn't ...
94
votes
2
answers
105k
views
ConcurrentHashMap and Hashtable in Java [duplicate]
What is the difference between a ConcurrentHashMap and a Hashtable in Java?
Which is more efficient for threaded applications?
54
votes
6
answers
28k
views
Difference between Hashtable and Collections.synchronizedMap(HashMap)
As far as I know, java.util.Hashtable synchronizes each and every method in the java.util.Map interface, while Collections.synchronizedMap(hash_map) returns a wrapper object containing synchronized ...