add All Iterable to Collection - Java Collection Framework

Java examples for Collection Framework:Iterable

Description

add All Iterable to Collection

Demo Code


//package com.java2s;
import java.util.Collection;

public class Main {
    public static <T> void addAll(Iterable<T> iterable,
            Collection<T> collection) {
        for (T item : iterable)
            collection.add(item);//from   w  ww  .  j  a  v  a 2s  .c o m
    }
}

Related Tutorials