Java Collection Tutorial - Java List.containsAll(Collection <?> c)


List.containsAll(Collection <?> c) has the following syntax.

boolean containsAll(Collection <?> c)


In the following code shows how to use List.containsAll(Collection <?> c) method.

//  w  ww.  j  a  va  2 s  . co  m
import java.util.Arrays;
import java.util.List;
public class Main {
  public static void main(String[] a) {
    List list = Arrays.asList(new String[] { "A", "B", "C", "D" });
    List list1 = Arrays.asList(new String[] { "A", "B", "C", "D" });

The code above generates the following result.