Vector.containsAll(Collection <?> c) has the following syntax.
public boolean containsAll(Collection <?> c)
In the following code shows how to use Vector.containsAll(Collection <?> c) method.
/*from w ww . j a v a2s. c om*/ import java.util.Vector; public class Main { public static void main(String[] args) { Vector<Integer> vec = new Vector<Integer> (4); Vector<Integer> vectest = new Vector<Integer> (4); Vector<Integer> vecdiff = new Vector<Integer> (4); vec.add(4); vec.add(3); vec.add(2); vectest.add(4); vectest.add(3); vectest.add(2); vecdiff.add(4); vecdiff.add(3); vecdiff.add(12); // let us check vec and vectest System.out.println(vectest.containsAll(vec)); // let us check vec and vecdiff System.out.println(vecdiff.containsAll(vec)); } }
The code above generates the following result.