Consider a text file of names, with one name per line, that has been compiled from several different sources. A sample is shown below:
Brooke Trout
Dinah Soars
Jed Dye
Brooke Trout
Jed Dye
Paige Turner
There are duplicate names in the file. We would like to generate an invitation list but don’t want to send multiple invitations to the same person. Write a program that eliminates the duplicate names by using a HashSet. Read each name from the file, add it to the HashSet, and then output all names in the HashSet to generate the invitation list without duplicates.
The solution is a fairly straightforward implementation of a HashSet
See the code in InviteList.java and data in names.txt
You might also like to view...
A process contains one or more threads, and Windows XP can concurrently execute those threads using a technique called __________.
a. multitasking b. multithreading c. context switching d. multiprogramming
What is the connector used in today's most common type of patch panel?
What will be an ideal response?
birth.month refers to the birth member of the month structure.
Answer the following statement true (T) or false (F)
Exporting an InDesign layout to an SWF file format creates two files: an index.swf file and a(n) _______________ .
Fill in the blank(s) with the appropriate word(s).