Java Collection to Array toArray(Collection collection)

Here you can find the source of toArray(Collection collection)

Description

to Array

License

Apache License

Declaration

public static Object[] toArray(Collection<?> collection) 

Method Source Code


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

import java.util.Collection;

public class Main {
    public static Object[] toArray(Collection<?> collection) {
        return collection.toArray(new Object[collection.size()]);
    }/*  w w  w.j av a 2s  . co m*/

    public static <E> E[] toArray(Collection<E> collection, E[] array) {
        return collection.toArray(array);
    }
}

Related

  1. convertToArray(Collection items)
  2. toArray(Collection c)
  3. toArray(Collection coll)
  4. toArray(Collection bytes)
  5. toArray(Collection c, T[] arr)
  6. toArray(Collection tests)
  7. toArray(Collection list)
  8. toArray(Collection values)
  9. toArray(Collection values)