Added constructor for java.util.HashMap

This commit is contained in:
Eric Scharff 2008-02-28 08:33:52 -07:00
parent c810eb36d8
commit 73e7bfc1dc

View File

@ -32,6 +32,13 @@ public class HashMap<K, V> implements Map<K, V> {
this(0);
}
public HashMap(Map<K, V> map) {
this(map.size());
for (Map.Entry<K, V> entry : map.entrySet()) {
put(entry.getKey(), entry.getValue());
}
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");