Language - Java Create a utility class called DuplicateCounter . Create an instance method called count that takes a single parameter called dataFile (representing the path to a text file) and uses a...


Language - Java



Create a utility class calledDuplicateCounter. Create an instance method calledcount that takes a single parameter calleddataFile (representing the path to a text file) and uses a Map of Strings to count how many times each word occurs indataFile. The counts should be stored in an instance variable calledwordCounter. Create an instance method calledwrite that takes a single parameter calledoutputFile (representing the path to a text file) and writes the contents ofwordCounter to the file pointed to by outputFile. The output file should be overwritten if it already exists, and created if it does not exist.


Create a separate class called Application that contains a main method which illustrates the use ofDuplicateCounter by calling both the remove and write methods. Your input file must be calledproblem2.txt and your output file must be calledunique_word_counts.tx


Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here