public static void main(String[] args) {
List<Integer> list = new ArrayList();
list.add(1);
list.add(1);
list.add(2);
list.add(3);
for (Integer integer : list) {
System.out.println("LIST集合");
System.out.println(integer);
}
Set<Integer> setList =new HashSet<>();
for (Integer lists: list) {
setList.add(lists);
}
for (Integer integer : setList) {
System.out.println("set集合");
System.out.println(integer);
}
}