Here you can find the source of collectionToStringArray(Collection objs)
public static String[] collectionToStringArray(Collection objs)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static String[] collectionToStringArray(Collection objs) { if (objs == null) return null; String[] ret = new String[objs.size()]; int idx = 0; for (Object o : objs) { ret[idx] = o.toString();//from w ww . j av a 2 s. c o m idx++; } return ret; } }