
CodeHS 5.8 HashMaps
Authored by Aaron Pavao
Computers
9th - 12th Grade
10 Questions
Used 16+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a HashMap?
a bunch of key-value pairs
a type of ArrayList
a type of 2D array
a type of 3D array
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many values can each key in a HashMap be associated with?
one
depends how you initialize the HashMap
unlimited
trick question--keys aren't associated with values in a HashMap
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of these lines of code creates a HashMap called foo that has an int for keys and a String for values?
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which line of code will add a second phone number "312-423-1234" to Charles Babbage?
phonebook.put("Charles Babbage", "312-423-1234");
phonebook.put("Charles Babbage", "312-423-1234")
phonebook.put("312-423-1234", "Charles Babbage");
trick question--you can't add a second value to a key
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be printed to the screen when the following code is executed:
System.out.println(phonebook.get("Grace Hopper"));
"650-352-7500"
650-352-7500
+44 330 058 0058
"+44 330 058 0058"
Grace Hopper
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What do you use to access every member of a HashMap?
a for loop
a for-each loop
an array
an ArrayList
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What do you use to find out how many key-value pairs are in the HashMap named bar?
bar.size()
bar.length
bar.size
bar.length()
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Quiz 3 โปรแกรมกราฟิกสำหรับผลิตสื่อดิจิทัล
Quiz
•
11th Grade
10 questions
TỪ BÀI TOÁN ĐẾN CHƯƠNG TRÌNH
Quiz
•
11th Grade
14 questions
[Lớp 12] Access - Ôn tập
Quiz
•
12th Grade
10 questions
Fun with Paint and Storage
Quiz
•
1st Grade - University
9 questions
1.5.1 - Starter Task/Social Engineering Starter (Dg)
Quiz
•
11th Grade
14 questions
ABC in python
Quiz
•
9th Grade
14 questions
Instlasi Software Aplikasi
Quiz
•
10th Grade
10 questions
Recap: Introduction to Python
Quiz
•
10th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade