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 String[] toArray(Collection<String> collection) 

Method Source Code

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

import java.util.Collection;

public class Main {

    public static String[] toArray(Collection<String> collection) {
        if (collection == null) {
            throw new IllegalArgumentException("argument must not be null.");
        }//from  w ww .ja  v  a 2  s . co  m
        return collection.toArray(new String[collection.size()]);
    }
}

Related

  1. toArray(Collection collection)
  2. toArray(Collection collection)
  3. toArray(Collection collection, Long defaultValue)
  4. toArray(Collection col)
  5. toArray(Collection collection)
  6. toArray(Collection list)
  7. toArray(Collection stringCollection)
  8. toArray(Collection strings)
  9. toArray(Collection values)