Here you can find the source of collectionToString(Object[] objects)
public static String collectionToString(Object[] objects)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { public static String collectionToString(Object[] objects) { String s = ""; for (int i = 0; i < objects.length; i++) { s += objects[i].toString();/*from www. j a v a 2 s . c o m*/ if (i < objects.length - 1) { s += ", "; } } return s; } public static String collectionToString(List<Object> objects) { String s = ""; for (int i = 0; i < objects.size(); i++) { s += objects.get(i).toString(); if (i < objects.size() - 1) { s += ", "; } } return s; } }