Codecademy Learn Java, HashMap Access, Accessing a HashMap

Lesson Summary

In this lesson for Codecademy's Learn Java course we look further into the Java HashMap. In this particular lesson we learn how to access the values within our HashMap. We learn that we can target a value within a HashMap by using its key. With Java arrays we learned we can access a value within the array by its index, well, with HashMaps we use the key to get the value. In this specific challenge we are asked to get the value of the "Naan Pizza" key. This returns the vallue 11 since Naan Pizza is the key whose value is 11.

Subscribe To Monthly Newsletter. Chance to Win Monthly Prizes

* indicates required