[英]How to check whether a HashMap has all the elements of an ArrayList?
[英]How to check whether the elements of an ArrayList are all contained in another ArrayList
如何轻松检查一个ArrayList中的所有元素是否都是另一个ArrayList的元素?
boolean isSubset = listA.containsAll(listB);
所有集合中都有一个containsAll方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.