Since we have the basic functionality of a hash map, let’s create a test instance of one for us to make sure everything works as expected.
HashMap class (completely unindented below the class definition) create a new hash map called
hash_map. Give it an array size of 20.
We want to use this hash map to store geologic information — types of rocks.
hash_map save the value
"metamorphic" for the key
Now retrieve the value of
hash_map for the key
gneiss. Print it out, does your
HashMap work as expected?