Answers for "how to remove duplicate item from arraylist in java using comparator"

0

how to remove duplicate item from arraylist in java using comparator

Set<FilterModel> set = new TreeSet<>(new Comparator<FilterModel>() {
@Override
public int compare(FilterModel o1, FilterModel o2) {
if (o1.getFtype().equalsIgnoreCase(o2.getFtype())) {
return 0;
}
return 1;
}
});

set.addAll(filterlist);
filterlist.clear();
filterlist.addAll(set);
Posted by: Guest on June-25-2021

Code answers related to "how to remove duplicate item from arraylist in java using comparator"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language