Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何轻松检查一个 ArrayList 中的所有元素是否都是另一个 ArrayList 的所有元素?
使用Collection.containsAll():
boolean isSubset = listA.containsAll(listB);
所有集合中都有一个 containsAll 方法。