Contents Prev: Sets

What are maps?

Maps contain a mapping from one type of objects to another.

Implementations

There's HashMap and TreeMap.

Map<String, Integer> map = new HashMap<>();
map.put("foo"3);
map.add("bar"42);

This is the output:

foo
bar
Contents Prev: Sets