Skip to content
free
K
1
2
practice
Home
Math
English
Science
Social Studies
Contact
Language
English
Español
Sign In
/
High School Electives
/
Computer Science
/
Arrays and Dynamic Lists
Grade Level
Computer Science
HSCS.145 Arrays and Dynamic Lists
0%
Skill Level
🔴 Hard
00:00
Progress to Next Level
25% to Medium
Easy
Medium
Hard
Mastery
100%
A search method receives a fixed Product[] catalog but returns only products whose names match a query. The number of matches is not known before searching. Which return collection is most appropriate?
A
ArrayList
because matches should be represented by indexes only.
B
ArrayList
because the search result can contain any number of matching products.
C
String[] because products should be converted to names before returning.
D
Product[] with the same length as the catalog and null for nonmatches.
Submit Answer