Java ArrayList Remove removeDuplicates(ArrayList al)

Here you can find the source of removeDuplicates(ArrayList al)

Description

remove Duplicates

License

Open Source License

Declaration

public static ArrayList<String> removeDuplicates(ArrayList<String> al) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static ArrayList<String> removeDuplicates(ArrayList<String> al) {
        Set<String> hs = new HashSet<>();
        hs.addAll(al);//from w ww  .  j a va2  s.co  m
        al.clear();
        al.addAll(hs);
        return al;
    }
}

Related

  1. removeAdditionalRanges(String line, ArrayList indices, ArrayList newRanges)
  2. removeAllFromArrayList(ArrayList collection, Collection toRemove)
  3. removeAllListaProd(ArrayList lista)
  4. removeAlreadyParsedFolders(ArrayList listStrings, String pickup, String limit)
  5. removeByReference(ArrayList list, T object)
  6. removeDuplicates(ArrayList a)
  7. removeDuplicateWithOrder(List arrayList)
  8. removeElementsFromIndexToEnd(ArrayList list, int index)
  9. removeExtraPunctuation(String line, int startChar, ArrayList indices)