Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsAddAllExample2 { public static void main(String[] args) { List
alist = new ArrayList
(); alist.add("Rahul"); alist.add("Karthik"); alist.add("OM"); alist.add("Shiva"); alist.add("Anand"); alist.add("Prem"); System.out.println("The List are: "+alist); boolean b = Collections.addAll(alist, "Rahul", "OM", "Prem"); System.out.println("Boolean Result: "+b); System.out.println("Collection Value: "+alist); } }
Output