Task 6 of 9 · 0 solved · 9 to go0%
You can read the problem, but answers are checked only for signed-in students. Sign in to answer →

10.1 HashMap — sum of all values

Total: 0 / 3 pts
Practice mode — check each part and get hints as you go.
Task

Fill in sumValues so that it returns the sum of all values. Loop over keySet() and read each value with get.

A sum is safe here: it comes out the same whatever order the keys are visited in. The program prints 55.

Your solution