标签:io ar strong for div cti sp on c
1 可以直接循环list,放到一个新list里
2 利用set
public List removeDeuplicate(List arlList)
{
HashSet h=new HashSet(arlList);
arlList.clear();
arlList.addAll(h);
List list=new ArrayList();
list=arlList;
return list;
}
private List<String> removeDuplicate(List<String> list)
{
List<String> result = new ArrayList<String>();
for (String s : list)
{
if (Collections.frequency(result, s) < 1)
result.add(s);
}
return result;
}
标签:io ar strong for div cti sp on c
原文地址:http://www.cnblogs.com/narci/p/3964037.html