Java Collection to Array toStringArray(Collection collection)

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

Description

to String Array

License

Open Source License

Declaration

static public String[] toStringArray(Collection collection) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Collection;

public class Main {
    static public String[] toStringArray(Collection collection) {
        String[] result = new String[collection.size()];
        int i = 0;
        for (Object obj : collection) {
            result[i++] = obj.toString();
        }/*w  w w.  jav a2  s. c  o m*/
        return result;
    }
}

Related

  1. toIntArray(final Collection collection)
  2. toIntArray(final Collection values)
  3. toLongArray(Collection collection)
  4. toLongArray(Collection collection)
  5. toStringArray(Collection collection)
  6. toStringArray(Collection collection)
  7. toStringArray(Collection collection)
  8. toStringArray(Collection collection)
  9. toStringArray(Collection collection)