【发布时间】:2019-12-07 04:20:38
【问题描述】:
我有两个 ArrayList,其中包含一个包含大量数据的用户定义类的列表。其中一个列表包含另一个列表的元素。
我想在新的 list3 中过滤掉 list1 中已经存在于 list2 中的数据。
我可以借助循环来做到这一点,但是由于数据量非常大,我不想使用循环。
Example:
List<Presentation> presentedDepartmentList //list 1
List<PresentationDetails> excludingDepartmentList //list 2
Both Presentation and PresentationDetails have a common field as
"departmentNumber". I want to filter out the entries in the
"excludingDepartmentList" from the "presentedDepartmentList".
由于我对 Java8 不熟悉,所以我在任务中遇到了困难。
谁能帮帮我?
【问题讨论】: