Java tutorial
//package com.java2s; import java.util.Collection; public class Main { /** * This * @param collection * @return */ public static String[] toStringArray(Collection<? extends Object> collection) { String[] strArray = new String[collection.size()]; int index = 0; for (Object obj : collection) { if (obj == null) { strArray[index] = "null"; } else { strArray[index] = obj.toString(); } index++; } return strArray; } /** * * @param items * @return */ public static String[] toStringArray(Object[] items) { String[] strArray = new String[items.length]; for (int index = 0; index < items.length; index++) { Object obj = items[index]; if (obj == null) { strArray[index] = "null"; } else { strArray[index] = items[index].toString(); } } return strArray; } }