0
Whatâs the error in here?
2 Answers
+ 1
(Optional) 1st make players a Map from a HashMap by changing line 4 to;
Map<String, Integer> players;
Then change your foreach to use it appropriately like;
(This is the main issue, Entry cannot be found as it is a sub of Map, and the name map doesn't exist in this scope)
for (Map.Entry<String, Integer> entry : players.entrySet()) {...}
0
error: cannot find symbol
13th line