Here you can find the source of arrayToString(Object[] objects)
public static String arrayToString(Object[] objects)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { public static String arrayToString(Object[] objects) { List<Object> x = newList(); x.addAll(Arrays.asList(objects)); return x.toString(); /*//from ww w . ja v a2 s . c o m StringBuilder sb = new StringBuilder(); sb.append("["); for(Object o:objects){ if(o==null){ sb.append("null"); } else { sb.append(o.getClass().getName()); sb.append("("+o+")"); } sb.append(":"); } sb.append("]"); return sb.toString();*/ } public static <T> List<T> newList() { return new ArrayList<T>(); } }