标签:object ext tor 去重 ati void array TE highlight
public static void main(String[] args) { List list = new ArrayList(); list.add("123"); list.add("456"); list.add("789"); list.add("456"); list.add("456"); Set temp = new HashSet(); List newList = new ArrayList(); Iterator<String> iterator = list.iterator(); while(iterator.hasNext()){ Object el = iterator.next(); if(temp.add(el)) newList.add(el); } System.out.println(newList); }
标签:object ext tor 去重 ati void array TE highlight
原文地址:https://www.cnblogs.com/shuaihan/p/9235284.html