Page 1 of 1

Hello, I need help with this JAVA exercise. Write a program that reads words from a text file and displays all the nondu

Posted: Thu May 05, 2022 12:51 pm
by answerhappygod
Hello, I need help with this JAVA exercise.
Write a program that reads words from a text file and displays
all the nonduplicate words in ascending order. The text
file can be read with a scanner object.
Write a program that uses a TreeMap to store an entry consisting
of a word and its count. For each word, check whether it is already
a key in the map. If not, add the entry to the map with the word as
a key and value of 1. Otherwise, increase the value for the word
(key) by 1 in the map. Use the same text file as the first
program.