write a program that compares two files. First, the program will read two file names from the
Fantastic news! We've Found the answer you've been seeking!
Question:
write a program that compares two files. First, the program will read two file names from the user. Next, the program should count how many words in the first file appears in the second. After that it should print a report of the comparison of two files.
The following outlines a plan to solve this problem.
1. Create two Scanner objects to read the two files.
2. Read all the words in the second file and add them to an ArrayList
3. Read each word in the first file and check to see whether it is in the ArrayList.
The outline provided does not contain all details. For an example, as you see from the output you have to perform two counts. You also have to properly handle Exceptions.
Below is a sample of how the program should run:
Related Book For
Posted Date: