public class SetTest {
public static void main(String[] args) {
Set set = new HashSet();
List<String> list = new ArrayList<String>();
list.add("123");
list.add("123");
set.addAll(list);
Iterator ite = set.iterator();
while (ite.hasNext()) {
System.out.println(ite.next());
}}
}
Set与list测试
时间: 2024-11-05 13:03:38