package eecs1022; import java.io.File; import java.io.FileNotFoundException; import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class Duplicates { public static void main(String[] args) throws FileNotFoundException { String name = "Lab1.ePost"; File file = new File(name); Scanner input = new Scanner(file); Map entries = new HashMap(); while (input.hasNextLine()) { String line = input.nextLine(); String[] part = line.split("\\s+"); String ppy = part[0]; Integer mark = Integer.parseInt(part[1]); Integer value = entries.put(ppy, mark); if (value != null) { System.out.println(ppy); } } input.close(); } }