how to remove all duplicate String in arraylist code example
Example: java remove duplicates
public static <T> ArrayList<T> removeDuplicates(ArrayList<T> list){
Set<T> set = new LinkedHashSet<>(list);
return new ArrayList<T>(set);
}
public static <T> ArrayList<T> removeDuplicates(ArrayList<T> list){
Set<T> set = new LinkedHashSet<>(list);
return new ArrayList<T>(set);
}