CodeHS 5.8 HashMaps
Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Aaron Pavao
Used 16+ times
FREE Resource
Enhance your content
10 questions
Show all answers
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()
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
emtech
Quiz
•
12th Grade
10 questions
EMPOWERMENT TECHNOLOGIES – QUIZ 7 [New]
Quiz
•
11th Grade
10 questions
Quiz 8 (01.09.2021)
Quiz
•
1st - 12th Grade
8 questions
Basic computer
Quiz
•
9th - 12th Grade
10 questions
Glastonbr.ICT Definitions
Quiz
•
9th Grade
10 questions
หน่วยที่ 4 Python
Quiz
•
12th Grade
10 questions
ICT as Platform for Change
Quiz
•
11th - 12th Grade
15 questions
Google Spreadsheet
Quiz
•
11th Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
11 questions
NEASC Extended Advisory
Lesson
•
9th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
10 questions
Boomer ⚡ Zoomer - Holiday Movies
Quiz
•
KG - University
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
20 questions
Multiplying and Dividing Integers
Quiz
•
7th Grade
Discover more resources for Computers
18 questions
Artificial Intelligence and Machine Learning Quiz
Quiz
•
9th Grade
35 questions
Computer Terminology Exercise #1 ( Multiple Choice)
Quiz
•
9th Grade
20 questions
Computer Components Exercise #4 - CTEA
Quiz
•
9th - 12th Grade
30 questions
Computer Terminology Exercise #1 ( Fill Ins)
Quiz
•
9th Grade
