How to check whether the elements of an ArrayList are all contained in another ArrayList
-
03-07-2019 - |
Question
How can I easily check to see whether all the elements in one ArrayList are all elements of another ArrayList?
Solution
boolean isSubset = listA.containsAll(listB);
OTHER TIPS
There is a containsAll method in all collections.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow