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
/
Instance and Class Members
Grade Level
Computer Science
HSCS.138 Instance and Class Members
0%
Skill Level
🔴 Hard
00:00
Progress to Next Level
25% to Medium
Easy
Medium
Hard
Mastery
100%
A `PathFinder` class uses a static `cache` that stores routes for the last map loaded. The app now needs several independent maps at once. Which refactor best matches the new requirement?
A
Move the cache into a local variable that is lost after each helper call.
B
Make the cache an instance field of each `PathFinder` and keep only true constants static.
C
Delete all route caching even when each object could cache safely.
D
Make every map static too so all maps share routes.
Submit Answer