Java Collection to Array toArray(final Collection collection)

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

Description

to Array

License

LGPL

Declaration

public static final String[] toArray(final Collection<String> collection) 

Method Source Code

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

import java.util.Collection;

public class Main {
    public static final String[] toArray(final Collection<String> collection) {
        if (collection == null)
            return null;
        final String[] a = new String[collection.size()];
        collection.toArray(a);// ww  w  .  j  av a  2 s . c  o  m
        return a;
    }
}

Related

  1. toArray(Collection collection)
  2. toArray(Collection list, Object[] type)
  3. toArray(final Collection c)
  4. toArray(final Collection coll, byte[] array)
  5. toArray(final Collection collection)
  6. toArray(java.util.Collection collection)
  7. toArray(T arrayOrCollection)
  8. toArrayInt(Collection integerCollection)
  9. toArrays(Collection strings)