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

10.3 Ordered collections — sorted word counts

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

Fill in report so that it returns a word count listed alphabetically, in the form word:count separated by spaces (with a trailing space).

The program prints apple:1 fig:1 pear:2 . Use a TreeMap — with a HashMap the order would not be guaranteed.

Your solution