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
First you need to override equal method in your custom class and define the matching criteria of removing list
public class CustomClass{
@Override
public boolean equals(Object obj) {
try {
CustomClass licenceDetail = (CustomClass) obj;
return name.equals(licenceDetail.getName());
}
catch (Exception e)
{
return false;
}
}
}
Second you call the removeAll() method
list1.removeAll(list2);