Please enable JavaScript to use CodeHS

AP Computer Science A (Mocha)

Lesson 5.11 HashMaps

Description

In this lesson, students will learn about HashMaps and use them to create solutions to real-world problems. HashMaps offer a different way of storing data in Java using a key/value pair. While this topic is out of scope for the AP test, it is a key data structure used in several programming languages and may make a good topic for after the AP test.


Objective

Students will be able to:

  • Explain what a HashMap is and when it should be used versus other data structures.
  • Create, modify, and retrieve values from a HashMap.
  • Loop through all values of a HashMap using an enhanced for loop.

Activities

These are all the activities included in the lesson

5.11.1 HashMaps
5.11.2 Quiz: HashMaps
5.11.3 The Phonebook
5.11.4 Word Counts