Java Utililty Methods Array to Collection

List of utility methods to do Array to Collection

Description

The list of methods to do Array to Collection are organized into topic(s).

Method

CollectionarrayToCollection(Collection collection, T[] elements)
array To Collection
for (T element : elements) {
    collection.add(element);
return collection;
CarrayToCollection(E[] array, C collection)
Constructs a new java.util.Collection that will contain the given array elements.
collection.clear();
for (E e : array) {
    collection.add(e);
return collection;
ListarrayToCollection(Object[] objs)
array To Collection
return new ArrayList(Arrays.asList(objs));
ListarrayToCollection(String[] values)
array To Collection
List<String> list = new ArrayList<String>(values.length);
Collections.addAll(list, values);
return list;