Java Array to Collection arrayToCollection(Collection collection, T[] elements)

Here you can find the source of arrayToCollection(Collection collection, T[] elements)

Description

array To Collection

License

Apache License

Declaration

public static <T> Collection<T> arrayToCollection(Collection<T> collection, T[] elements) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Collection;

public class Main {

    public static <T> Collection<T> arrayToCollection(Collection<T> collection, T[] elements) {
        for (T element : elements) {
            collection.add(element);/* ww  w  .ja v a 2s . c o  m*/
        }
        return collection;
    }
}

Related

  1. arrayToCollection(E[] array, C collection)
  2. arrayToCollection(Object[] objs)
  3. arrayToCollection(String[] values)