Online Java Compiler By
JavaTpoint.com
package myPackage; import java.util.*; public class CollectionsDisjointExample2 { public static void main(String[] args) { //Create two lists List<Integer> list = Arrays.asList(10, 20, 30, 40); List<Integer> list2 = Arrays.asList(10, 20, 30, 4, 5, 6); boolean b = Collections.disjoint(list, list2); System.out.println("Output: "+b); } }
Output