How do you remove the overlapping contents of one List from another List?

后端 未结 1 706
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-02 03:10
List listA = new ArrayList();
listA.add(\"a\");
listA.add(\"b\");
listA.add(\"c\");
listA.add(\"d\");



List listB = new A         


        
1条回答
  •  青春惊慌失措
    2021-01-02 03:25

    listB.removeAll(listA)
    

    This would make your listB contain only [e, f].

    0 讨论(0)
提交回复
热议问题