考虑到我有一个Student只有 getter 和 setter的 Java 对象,我无法更改,以及两个 Lists——students1而且students2都是 type ArrayList<Student>。
Student
students1
students2
ArrayList<Student>
如何students1.removeAll(students2)通过传递我自己的equals()方法来调用?
students1.removeAll(students2)
equals()
这是因为我无法修改Student类。
java collections
collections ×1
java ×1