我在完全删除重复字符串时遇到问题List<String>
String [] myno1 = new String [] {"01", "02", "03", "04", "05", "06",
"07", "08", "09", "10", "11", "12", "13", "14", "15"};
String [] myno = new String [] {"01", "03", "15"};
List<String> stringList = new ArrayList<String>(Arrays.asList(myno));
List<String> stringList1 = new ArrayList<String>(Arrays.asList(myno1));
stringList.addAll(stringList1);
Set<String> set = new HashSet<>(stringList);
stringList.clear();
stringList.addAll(set);
System.out.println("=== s:" +stringList);
但我得到了这个:
=== s:[15, 13, 14, 11, 12, 08, 09, 04, 05, 06, 24, 07, 01, 02, 03, 10]
我希望结果是这样的:
=== s:[13, 14, 11, 12, 08, 09, 04, 05, 06, 24, 07, 02, 10]
倚天杖
PIPIONE
慕盖茨4494581
相关分类