Online Java Compiler By
JavaTpoint.com
import java.util.ArrayDeque; import java.util.Collection; public class JavaCollectionContainsAllExample3 { public static void main(String[] args) { int capacity=10; Collection
collection=new ArrayDeque<>(); collection.add("Himanshu"); collection.add("Sham"); collection.add("Rita"); /*containsAll() method will return a boolean value if the all the elements are present in the invoked collection*/ System.out.println(collection.containsAll(null)); } }
Output