Here you can find the source of arrayToString(Object array)
public static String arrayToString(Object array)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w ww . j ava 2s . c o m * Convenience method. Just casts the given object to Object[] * and calls the other version of this method. */ public static String arrayToString(Object array) { if (array == null) return "null"; else return arrayToString((Object[]) array); } /** * Prints each object in the array with commas between them. * Nulls will print as "null". A null array will cause NPE. */ public static String arrayToString(Object[] array) { StringBuffer outputString = new StringBuffer(100); for (int i = 0, n = array.length; i < n; i++) { if (i > 0) outputString.append(", "); outputString.append(array[i]); } return outputString.toString(); } }