List2、list之间取差集intersection = list1.stream() .filter(item -> list2.contains(item)).collect(Collectors.toList());
List3、list之间取并集reduce1 = list1.stream() .filter(item -> !list2.contains(item)).collect(Collectors.toList());
list1.addAll(listA2);4、list之间取去重
ListlistAllDistinct = list1.stream() .distinct().collect(Collectors.toList());
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)