Solved

Consider the Following Code Snippet: Map<String, Integer> Scores;

Question 43

Multiple Choice

Consider the following code snippet: Map<String, Integer> scores;
You expect to retrieve elements randomly by key, and want fastest retrieval times. Which of the following statements will create a structure to support this?


A) scores = new HashMap<String, Integer>;
B) scores = new TreeMap<String, Integer>;
C) scores = new Map<String, Integer>;
D) scores = new TreeSet<String, Integer>;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions