Here you can find the source of addAll(T[] lhs, Collection
Parameter | Description |
---|---|
lhs | The left-hand side. Elements of this array will be added to the collection. |
rhs | The right-hand side. Elements from the left-hand side will be added to this collection. |
public static <T> void addAll(T[] lhs, Collection<T> rhs)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { /**/*from www.j av a 2 s. c o m*/ * Add all elements from an array into a given collection of the same type. * * @param lhs * The left-hand side. Elements of this array will be added to * the collection. * @param rhs * The right-hand side. Elements from the left-hand side will be * added to this collection. */ public static <T> void addAll(T[] lhs, Collection<T> rhs) { for (int i = 0; i != lhs.length; ++i) { rhs.add(lhs[i]); } } }