/** * 获取两个List的不同元素 * @param list1 * @param list2 * @return */ private static List getDiffrent(List list1, List list2) { List diff = new ArrayList(); for(String str:list1) { if(!list2.contains(str)) { diff.add(str); } } return diff; }
转载于:https://www.cnblogs.com/YFeiY7/p/6485810.html