I dont want to check if they are equal, but if list a elements are in list b
List<String> ListA // "yes","no","maybe"
List<String> ListB // "yes","no","maybe", "perhaps"
I dont want to check if they are equal, but if list a elements are in list b
List<String> ListA // "yes","no","maybe"
List<String> ListB // "yes","no","maybe", "perhaps"
You can use the containsAll()
method:
listB.containsAll(listA)
Note:
Please, try to follow Java naming conventions, use someVariable
names for variables and methods. Names like SomeClass
are used for classes.