Solved

Consider the Following Code Snippet

Question 96

Multiple Choice

Consider the following code snippet:
Map<String, Integer> scores;
If you need to visit the keys in sorted order, 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 HashTable<String, Integer>;

Correct Answer:

verifed

Verified

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

Related Questions