I\'m trying to read in from two files and store them in two separate arraylists. The files consist of words which are either alone on a line or multiple words separated by c
You can use the removeAll method to remove the items of one list from another list.
removeAll
To obtain the duplicates you can use the retainAll method, though your approach with the set is also good (and probably more efficient)
retainAll