0

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"
Doc Holiday
  • 9,928
  • 32
  • 98
  • 151
  • 1
    http://docs.oracle.com/javase/7/docs/api/java/util/List.html#containsAll%28java.util.Collection%29 – assylias Mar 18 '14 at 16:56

1 Answers1

8

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.

Christian Tapia
  • 33,620
  • 7
  • 56
  • 73