diff --git a/src/data_structures/hashmap.md b/src/data_structures/hashmap.md new file mode 100644 index 0000000..b2d3680 --- /dev/null +++ b/src/data_structures/hashmap.md @@ -0,0 +1,20 @@ +### Hashmaps + +With arrays you have to store data in an ordered sequence identified with a indx. `Hashmaps` store data in a (key, pair) sequence that you can access by the index referring to another Object(indx is also an Object) + +```java +import java.util.HashMap; +HashMap Name = new HashMap(); +``` + +**Functions:** + +```java +map.put(identifier, value); +map.get(identifier); +map.remove(identifier); +map.clear(); // Deletes the whole map +map.size(); +``` + +Note: use `keyset()` to only get keys and `values()` to get specific Object values in loops