Question: Stuck at one part of finding duplicates in a java program. My getOverLap(), is my problem. Thanks for any advice! 1 /******************************* 2 * Author:
Stuck at one part of finding duplicates in a java program. My getOverLap(), is my problem.
Thanks for any advice!
1 /******************************* 2 * Author: Danielle Coulter 3 * Title: a2_scan_for_duplicates.java 4 * Description: ArrayLists and duplicates 5 * Material: Chapter 10 6 * Date: 10/15/2017 7 * 8 * 9 * This program is designed to accept input from one .txt file, 10 * arrange the words into an array, and then scan for duplicates. 11 * 12 * Duplicates will be removed and then displayed on the console. 13 * 14 * @author Danielle Coulter 15 ****************************** 16 */ 17 18 import java.util.ArrayList; 19 import java.util.Collections; 20 import java.util.HashMap; 21 import java.util.Map; 22 import java.util.Scanner; 23 import java.io.FileNotFoundException; 24 import java.io.File; 25 26 public class a2_scan_for_duplicates{ 27 28 public static void main(String []args) 29 throws FileNotFoundException { 30 31 //hard-coded filename 32 //Scanner in1 = new Scanner(new File("words.txt")); 33 Scanner console = new Scanner(System.in); 34 35 //Prompt user for file name 36 System.out.println("Let's clean this up!"); 37 System.out.println("What's your file name? "); 38 Scanner in1 = new Scanner(new File(console.nextLine())); 39 System.out.println(); 40 41 //Scan words in file and store in a list 42 ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
