Here you can find the source of addAll(Collection
Parameter | Description |
---|---|
intoCollection | a parameter |
fromCollection | a parameter |
public static <T> void addAll(Collection<T> intoCollection, Collection<? extends T> fromCollection)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { /**/* w ww . j av a 2 s. co m*/ * Adds all the items in "fromCollection" into "intoCollection". * <BR> * There was a bug in some implementations of Collection.addAll() method in some versions of J2SE, so to be on the * safe side, I implement it here. * @param intoCollection * @param fromCollection */ public static <T> void addAll(Collection<T> intoCollection, Collection<? extends T> fromCollection) { for (T t : fromCollection) { intoCollection.add(t); } } }